-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Better way to run parallel test processes in different directories #48399
Conversation
If one is using the parallel mechanism to run the equivalent of a "matrix" - more than one changing substitution - what's the recommended way to do this with --user-dir? --user-dir=something depending on {1} and {2}, I would guess - which would need to remove any filesystem-sensitive characters from the {1} and {2}? See #47791 for one particular case involved. |
What comes to my mind is |
If you wanted to make them look as similar as possible to the input but avoid a ew problem characters you could convert problematic characters with something like |
@@ -165,8 +165,8 @@ then | |||
make -j$num_jobs | |||
cd .. | |||
# Run regular tests | |||
[ -f "${bin_path}cata_test" ] && parallel --verbose --linebuffer "run_test $(printf %q "${bin_path}")'/cata_test' {} '('{}')=> '" ::: "crafting_skill_gain" "[slow] ~crafting_skill_gain" "~[slow] ~[.]" | |||
[ -f "${bin_path}cata_test-tiles" ] && parallel --verbose --linebuffer "run_test $(printf %q "${bin_path}")'/cata_test-tiles' {} '('{}')=> '" ::: "crafting_skill_gain" "[slow] ~crafting_skill_gain" "~[slow] ~[.]" | |||
[ -f "${bin_path}cata_test" ] && parallel --verbose --linebuffer --link "run_test $(printf %q "${bin_path}")'/cata_test' {2} {1} '('{1}')=> '" ::: "crafting_skill_gain" "[slow] ~crafting_skill_gain" "~[slow] ~[.]" ::: "--user-dir=process1" "--user-dir=process2" "--user-dir=process3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to change the run_test
function to accept the new argument. (Or you can instead append the command line option to the first argument, I suppose.)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered. |
Summary
None
Purpose of change
My solution to avoid concurrent filesystem access in #47134 is not ideal. I drilled a hole in the
WORLD
class to make test processes run in unique worlds named by its PID, but @jbytheway suggested a more elegant solution: pass--user-mod=<dir>
tocata_test
. I wanted to change it but was distracted by other things.Describe the solution
Repay the technical debt. Adopt @jbytheway's suggestion.
Testing
Wait for tests to complete on this pull request.