Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flaky test pass1 #693

Merged
merged 6 commits into from
Jan 6, 2025
Merged

Flaky test pass1 #693

merged 6 commits into from
Jan 6, 2025

Conversation

bretambrose
Copy link
Contributor

@bretambrose bretambrose commented Dec 19, 2024

  • Update shared subscription test to remove invalid assertions on a property that does not necessarily hold (all subscriptions receive messages)
  • Increase socket timeout on request-response 311 tests
  • Update 311 will test to work around broker race condition wrt which connection gets terminated on duplicate client id

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

interruptConnection->Connect((Aws::Crt::String("test-01-") + uuidStr).c_str(), true);
{
std::unique_lock<std::mutex> lock(interruptMutex);
interruptCv.wait(lock, [&]() { return interruptConnectionAttemptComplete; });
Copy link
Contributor

Choose a reason for hiding this comment

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

Not really an issue for this PR, while I just wonder if we have any mechanism that help to improve the infinitely waiting on the mutex/future? We used futures and mutex in plenty of places in the unit tests, and did not have a proper way to timeout for the wait so far.

Copy link
Contributor Author

@bretambrose bretambrose Jan 6, 2025

Choose a reason for hiding this comment

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

We'd need to update the condition variable wait to be time based and then check the result (rather than assume it's set) and fail the test.

So here, it would change to something like:

...
interruptCv.wait(lock, [&]() { return interruptConnectionAttemptComplete; }, std::chrono::seconds(60));
ASSERT_TRUE(interruptConnectionAttemptComplete);

@bretambrose bretambrose merged commit 9ad3311 into main Jan 6, 2025
63 checks passed
@bretambrose bretambrose deleted the FlakyTestPass1 branch January 6, 2025 19:59
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