ipc-channel icon indicating copy to clipboard operation
ipc-channel copied to clipboard

router tests are non-deterministic because of shared router

Open vvuk opened this issue 9 years ago • 2 comments

All of the tests use the global ROUTER RouterProxy, meaning that test runs end up depending on test order, number of threads, etc.

If everything's working okay, this isn't an issue -- but right now I'm chasing down an issue where every router test passes individually, and they will often pass when run in sequence, but every once in a while one will fail with a hard-to-track-down unwrap() panic after a previous one succeeded.

vvuk avatar Oct 04 '16 14:10 vvuk

You can probably avoid the non-determinism by runnig with RUST_TEST_THREADS=1. I agree though that this is not ideal...

Note that such intermittent failures actually do indicate real problems I believe -- either in some of the other test cases (leaving something in an unclean state), or in the actual implementation. If you could track them down, that would be highly appreciated.

antrik avatar Oct 04 '16 16:10 antrik

It was a problem in my implementation (what I suspected to begin with -- basically an accidental stomping of a buffer when a few async things were going on at once). RUST_TEST_THREADS=1 helps for sure, but it still ends up being dependent on what tests you run if you don't run all of them.

vvuk avatar Oct 06 '16 00:10 vvuk