Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cpp/obs/test/moq-output-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ int main()
CHECK(WaitFor([&] { return output.IsLiveSession() && relay.Accepted() == 1; }));
// The plugin names itself ahead of the C++ package, so a relay can tell it apart.
CHECK(relay.Advertised("moq-obs/dev moq-cpp/"));
OutlastHealthy();
relay.DropSessions();
CHECK(WaitFor([&] { return output.GetReconnectCount() == 1 && output.IsLiveSession(); }));
CHECK(MoQOutputStatsTest::Instance(output) == first);
Expand Down Expand Up @@ -995,6 +996,7 @@ int main()
MoQOutput o(nullptr, OUTPUT);
CHECK(o.Start());
CHECK(WaitFor([&] { return o.IsLiveSession() && relay.Accepted() == 1; }));
OutlastHealthy();
relay.DropSessions();
CHECK(WaitFor([&] { return relay.Accepted() == 2; }));
CHECK(WaitFor([&] { return o.GetReconnectCount() == 1; }));
Expand All @@ -1013,6 +1015,7 @@ int main()
MoQOutput o(nullptr, OUTPUT);
CHECK(o.Start());
CHECK(WaitFor([&] { return o.IsLiveSession(); }));
OutlastHealthy();
relay.reset();
MoQOutput::ConnectionStats stats;
CHECK(WaitFor([&] { return !o.TryGetConnectionStats(&stats); }));
Expand Down
1 change: 1 addition & 0 deletions cpp/obs/test/moq-source-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1769,6 +1769,7 @@ int main()
Publisher publisher(relay, "obs/test");
void *source = createSource();
CHECK(publisher.WriteUntil([] { return g_output_frames > 0 && g_output_audio > 0; }));
OutlastHealthy();
relay.DropSessions();
CHECK(WaitFor([&] { return relay.Accepted() == 2; }));
const int frames = g_output_frames;
Expand Down
8 changes: 8 additions & 0 deletions cpp/obs/test/moq-test-relay.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ inline bool WaitFor(const std::function<bool()> &done, std::chrono::milliseconds
return true;
}

// Lets a session the test just saw go live outlast moq-ffi's healthy bar, which has no
// override: a session its peer closes sooner ends the client, as a refused one does, where
// one closed later redials.
inline void OutlastHealthy()
{
std::this_thread::sleep_for(std::chrono::seconds(1));
}

// Runs whatever `worker` already queued, so a test checks what an object's dropped calls
// did without waiting out a window. Dropping a moq::Continuation does not recall a result
// whose delivery already began, which can still queue after this returns: a check after
Expand Down