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

amqp_client_SUITE: Fix several test flakes #13147

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

dumbbell
Copy link
Member

How

  1. Use feature flags correctly: the code shouldn't test if a feature flag is enabled, assuming something else enabled it. It should enable it and react to an error.
  2. Use close_connection_sync/1 instead of the asynchronous amqp10_client:close_connection/1 to make sure they are really closed. The wait in end_per_testcase/2 was not enough apparently.
  3. For the two testcases that flake the most for me, enclose the code in a try/after and make sure to close the connection at the end, regardless of the result. This should be done for all testcases because the testgroup use a single set of RabbitMQ nodes for all testcases, therefore testcases are supposed to clean up after them…

[How]
1. Use feature flags correctly: the code shouldn't test if a feature
   flag is enabled, assuming something else enabled it. It should enable
   it and react to an error.
2. Use `close_connection_sync/1` instead of the asynchronous
   `amqp10_client:close_connection/1` to make sure they are really
   closed. The wait in `end_per_testcase/2` was not enough apparently.
3. For the two testcases that flake the most for me, enclose the code in
   a try/after and make sure to close the connection at the end,
   regardless of the result. This should be done for all testcases
   because the testgroup use a single set of RabbitMQ nodes for all
   testcases, therefore testcases are supposed to clean up after them...
@dumbbell dumbbell self-assigned this Jan 24, 2025
@dumbbell dumbbell marked this pull request as ready for review January 24, 2025 15:35
@dumbbell dumbbell merged commit e883df4 into main Jan 24, 2025
272 checks passed
@dumbbell dumbbell deleted the fix-test-flakes-in-amqp_client_SUITE branch January 24, 2025 15:35
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.

1 participant