Skip to content

Test: streams events tests#432

Open
zurekz wants to merge 5 commits into
develfrom
test/streams-events-tests
Open

Test: streams events tests#432
zurekz wants to merge 5 commits into
develfrom
test/streams-events-tests

Conversation

@zurekz
Copy link
Copy Markdown
Member

@zurekz zurekz commented May 13, 2026

No description provided.

Comment thread test/tests/StreamEventsTest.cpp Outdated
auto event = eventHolder.value().get();
if(event == nullptr || event->type != "streamRoomCreated") {
continue;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

triggerStreamRoomCreatedEvent schould create only "streamRoomCreated" Event, so if it create differt event test schould failed.

Comment thread test/tests/StreamEventsTest.cpp Outdated
auto streamRoomId = createStreamRoomFor(user1, user2);
ScopeExit cleanup([&user2]() { user2.disconnect(); });
subscribeForAllStreamEventQueries(user1, streamRoomId);
subscribeForAllStreamEventQueries(user2, streamRoomId);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use fine grain subscription, ak subscribing only for event which we testing, to check: A) is subscription is working, B) it's gives us subscription that we want, C) any of other internal subscriptions don't leak to public API

Comment thread test/tests/StreamEventsTest.cpp Outdated
auto streamRoomId = createStreamRoomFor(user1, user2);
ScopeExit cleanup([&user2]() { user2.disconnect(); });
subscribeForAllStreamEventQueries(user1, streamRoomId);
subscribeForAllStreamEventQueries(user2, streamRoomId);
Copy link
Copy Markdown
Member

@Uriagat Uriagat May 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in R438

Comment thread test/tests/StreamEventsTest.cpp Outdated
auto streamRoomId = createStreamRoomFor(user1, user2);
ScopeExit cleanup([&user2]() { user2.disconnect(); });
subscribeForAllStreamEventQueries(user1, streamRoomId);
subscribeForAllStreamEventQueries(user2, streamRoomId);
Copy link
Copy Markdown
Member

@Uriagat Uriagat May 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in R438

Comment thread test/tests/StreamEventsTest.cpp Outdated
auto streamRoomId = createStreamRoomFor(user1, user2);
ScopeExit cleanup([&user2]() { user2.disconnect(); });
subscribeForAllStreamEventQueries(user1, streamRoomId);
subscribeForAllStreamEventQueries(user2, streamRoomId);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in R438

Comment thread test/tests/StreamEventsTest.cpp Outdated
auto streamRoomId = createStreamRoomFor(user1, user2);
ScopeExit cleanup([&user2]() { user2.disconnect(); });
subscribeForAllStreamEventQueries(user1, streamRoomId);
subscribeForAllStreamEventQueries(user2, streamRoomId);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in R438

Comment thread test/tests/StreamEventsTest.cpp Outdated
auto streamRoomId = createStreamRoomFor(user1, user2);
ScopeExit cleanup([&user2]() { user2.disconnect(); });
subscribeForAllStreamEventQueries(user1, streamRoomId);
subscribeForAllStreamEventQueries(user2, streamRoomId);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in R438

Comment thread test/tests/StreamEventsTest.cpp Outdated
auto streamRoomId = createStreamRoomFor(user1, user2);
ScopeExit cleanup([&user2]() { user2.disconnect(); });
subscribeForAllStreamEventQueries(user1, streamRoomId);
subscribeForAllStreamEventQueries(user2, streamRoomId);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in R438

Comment thread test/tests/StreamEventsTest.cpp Outdated
auto streamRoomId = createStreamRoomFor(user1, user2);
ScopeExit cleanup([&user2]() { user2.disconnect(); });
subscribeForAllStreamEventQueries(user1, streamRoomId);
subscribeForAllStreamEventQueries(user2, streamRoomId);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in R438

Comment thread test/tests/StreamEventsTest.cpp Outdated
auto streamRoomId = createStreamRoomFor(user1, user2);
ScopeExit cleanup([&user2]() { user2.disconnect(); });
subscribeForAllStreamEventQueries(user1, streamRoomId);
subscribeForAllStreamEventQueries(user2, streamRoomId);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in R438

Comment thread test/tests/StreamEventsTest.cpp Outdated
TEST_F(StreamEventsTest, waitEvent_getEvent_streamRoomCreated_two_users) {
EXPECT_NO_THROW({
eventQueue.waitEvent(); // pop fixture libConnected from queue
});
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you use it if you have function drainEventQueue()

Comment thread test/tests/StreamEventsTest.cpp Outdated
continue;
}
auto event = eventHolder.value().get();
if(event == nullptr || event->type != eventType) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when waiting for given event Type and you revive other event, you should minimum LOG unwanted event, but in most cases in test it should fails because it receives unwanted event on API site

@Uriagat Uriagat force-pushed the test/streams-events-tests branch from 11b01d7 to aaa11ed Compare May 25, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants