Repository navigation
Restore the working directory after each sync test - #1271
Merged
Merged
Conversation
ExUnit kills a test that times out, so the File.cd!/2 in in_tmp/2 never changes back and the VM's working directory stays in the test's tmp directory. All audit tests share one in_tmp directory, so the next one deleted the working directory, and every later File.cwd!/0 failed. One timed out audit test failed 290 tests in https://github.com/hexpm/hex/actions/runs/38185790314. Restore the working directory from an on_exit callback, which runs even when the test is killed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In https://github.com/hexpm/hex/actions/runs/38185790314 one audit test timed out and 290 tests failed after it. ExUnit kills a test that times out, so the
File.cd!/2inin_tmp/2never changes back and the VM's working directory stays in the test's tmp directory.in_tmp/1names the directory after the calling function, and every audit test calls it throughwith_test_package/3, so they all share one directory. The next audit test deletes the working directory, and every laterFile.cwd!/0fails. When I reproduced it locally, that crashedMix.ProjectStack, and the rest of the suite failed withArgumentErrorbecause theMix.StateETS table was gone.This restores the working directory from an
on_exitcallback in the sync test setup, which runs even when the test is killed. With one audit test made to hang (--seed 0, 15 s timeout),mainfails 116 of 837 tests and this branch fails only the hung one.Going by that run's log, the timeout itself looks like the
Mix.Sync.Lockdeadlock fixed on Elixir main in elixir-lang/elixir#15765, which isn't in a release yet.