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

failure: cache::test::sync_test::test_cache_drop_updates, when running with multiple threads #31

Open
FrankReh opened this issue Dec 19, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@FrankReh
Copy link

I haven't figured out if the failure is caused by a problem with the library or with the test. I do seem to have narrowed it down to only failing when the test is run with multiple threads and allowing all the test to be run. When the test is limited to a single thread, or when the test is run in isolation (cargo test --release --lib test_cache_drop_updates -- --test-threads=4), it seems to pass each time.

cargo test and cargo test --release often, but not always, fails with

failures:

---- cache::test::sync_test::test_cache_drop_updates stdout ----
thread 'cache::test::sync_test::test_cache_drop_updates' panicked at 'assertion failed: c.insert(1, \"0\".to_string(), 10)', src/cache/test.rs:680:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    cache::test::sync_test::test_cache_drop_updates

but running with cargo test -- --test-threads=1 sees it pass each time. I wonder if other tests that preceded this one are having an affect because when the one test is run in isolation, it always passes too.

If it were determined the test isn't designed for multiple threads, I would suggest creating a .cargo/config.toml with

[env]
RUST_TEST_THREADS = { value = "1" }

I would offer a PR but as I said at the top, I don't know if a real problem is being masked by just running the one test or just running with one thread.

@FrankReh FrankReh changed the title unit test failure, when running with multiple threads failure: cache::test::sync_test::test_cache_drop_updates, when running with multiple threads Dec 19, 2022
@al8n al8n added the enhancement New feature or request label Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants