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

Fix/resolve flaky error in tests #872

Merged
merged 10 commits into from
Nov 23, 2024

Conversation

andsel
Copy link
Collaborator

@andsel andsel commented Nov 23, 2024

Release notes

[rn:skip]

What does this PR do?

Fixes some flaky test acting on 3 things:

  • drop from custom low level client the callback mechanism and the queue, but resort just in the queued messages an wait blocking on it.
  • updates the Publish collect based on Paho client to release the latch only after having copied the data, to avoid nulls due to read ordering
    From
latch.countDown();
receivedTopic = topic;
receivedMessage = message;

to

receivedTopic = topic;
receivedMessage = message;
latch.countDown();
  • in HiveMQ client usages, register the listener to subscribe before the verification and not during the verification. This makes the code less linear, but it's the intended use of the API.

receivedTopic = topic;
receivedMessage = message;
latch.countDown();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Switch the order so that the latch release happens only after the data has been copied, else the client can read null values.

@andsel andsel force-pushed the fix/resolve_flaky_error_in_tests branch from 9319da3 to 2c57034 Compare November 23, 2024 17:51
@andsel andsel force-pushed the fix/resolve_flaky_error_in_tests branch from 2c57034 to 249967a Compare November 23, 2024 18:00
@andsel andsel marked this pull request as ready for review November 23, 2024 18:14
@andsel andsel merged commit 9bb4d90 into moquette-io:main Nov 23, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant