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

made tests more deterministic #129

Merged
merged 1 commit into from
Jun 15, 2024
Merged

made tests more deterministic #129

merged 1 commit into from
Jun 15, 2024

Conversation

pompon0
Copy link
Contributor

@pompon0 pompon0 commented Jun 15, 2024

Some of the tests were flaky because of cpu contention affecting interleavings. This fix makes the passing time (almost) deterministic, by the use of tokio::time::pause(). The other consequence is that runtime used in multiple tests has been changed from multi-threaded to single-threaded. This also helps the determinism because the nextest parallelism is bounded by the number of cores - if we make all tests single-threaded, behavior of the test will be the same when executed separately and in a test suite.

Also converted a should_panic test to regular test for consistency.
Tuned size of some of the tests to reasonable execution times.

@pompon0 pompon0 requested a review from brunoffranca as a code owner June 15, 2024 21:14
@pompon0 pompon0 requested a review from aakoshh June 15, 2024 21:14
Copy link
Contributor

@aakoshh aakoshh left a comment

Choose a reason for hiding this comment

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

Nice, tokio::time::pause seems to be exactly what I have been looking for 👍

@pompon0 pompon0 merged commit 03409a5 into main Jun 15, 2024
5 checks passed
@pompon0 pompon0 deleted the gprusak-test branch June 15, 2024 21:39
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