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

Racy tests #3

Open
workingjubilee opened this issue Aug 10, 2024 · 1 comment
Open

Racy tests #3

workingjubilee opened this issue Aug 10, 2024 · 1 comment

Comments

@workingjubilee
Copy link

workingjubilee commented Aug 10, 2024

Your tests appear to be pretty racy, unfortunately:

[INFO] [stdout] running 6 tests
[INFO] [stdout] test integration_2_thread_limited ... ok
[INFO] [stdout] test integration_1_thread_recurrance ... ok
[INFO] [stdout] test integration_2_threads_poll_preferred ... ok
[INFO] [stdout] test integration_2_threads_block ... ok
[INFO] [stdout] test integration_1_thread_blocked ... FAILED
[INFO] [stdout] test panic_in_job ... ok
[INFO] [stdout] 
[INFO] [stdout] failures:
[INFO] [stdout] 
[INFO] [stdout] ---- integration_1_thread_blocked stdout ----
[INFO] [stdout] Completed job WaitJob(10µs took 546.84µs, 3, None, 'b', ..)
[INFO] [stdout] Completed job WaitJob(400µs took 1.32904ms, 1, None, 'a', ..)
[INFO] [stdout] Completed job WaitJob(10µs took 1.13645ms, 1, None, 'c', ..)
[INFO] [stdout] Completed job WaitJob(10µs took 1.2256ms, 1, None, 'd', ..)
[INFO] [stdout] Completed job WaitJob(10µs took 1.31299ms, 1, None, 'e', ..)
[INFO] [stdout] thread 'integration_1_thread_blocked' panicked at tests/integration.rs:57:5:
[INFO] [stdout] assertion `left == right` failed
[INFO] [stdout]   left: "abcde"
[INFO] [stdout]  right: "bacde"
test source::test::queued_resets_recurring ... FAILED

failures:

---- source::test::queued_resets_recurring stdout ----
thread 'source::test::queued_resets_recurring' panicked at src/source.rs:320:9:
assertion `left == right` failed
  left: [Tester(3), Tester(2), Tester(1)]
 right: [Tester(2)]


failures:
    source::test::queued_resets_recurring

test result: FAILED. 36 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s

It's not immediately clear to me what's wrong but you should, in particular, be aware that thread::sleep promises only a minimum, not a maximum, of a sleep time.

@workingjubilee
Copy link
Author

And to be clear:

Limitations

some of the tests are very dependent on timing and will fail if run slowly

My computer is very not-slow.

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

No branches or pull requests

1 participant