You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into an issue today running cargo test, where one of the tests in notion-core/src/image/mod.rs was failing even though I hadn't made any changes to that file.
After doing a little bit of digging, it looked like what was happening was one of the tests was setting PATH at the beginning of its function, then assuming that it would always be the same value throughout. However, since the tests are run in parallel, one of the other tests was overwriting that environment variable in the middle of running itself, causing the last assertion in the first test to fail.
We can fix this by preventing the tests from running in parallel (which seems like a poor option, not taking advantage of available processing power), or by consolidating all of the tests in that module into a single test method. Then we can be sure that each line will run serially and that there won't be a race condition with the environment variables causing sporadic failures.
The text was updated successfully, but these errors were encountered:
I ran into an issue today running
cargo test
, where one of the tests innotion-core/src/image/mod.rs
was failing even though I hadn't made any changes to that file.After doing a little bit of digging, it looked like what was happening was one of the tests was setting
PATH
at the beginning of its function, then assuming that it would always be the same value throughout. However, since the tests are run in parallel, one of the other tests was overwriting that environment variable in the middle of running itself, causing the last assertion in the first test to fail.We can fix this by preventing the tests from running in parallel (which seems like a poor option, not taking advantage of available processing power), or by consolidating all of the tests in that module into a single test method. Then we can be sure that each line will run serially and that there won't be a race condition with the environment variables causing sporadic failures.
The text was updated successfully, but these errors were encountered: