Summary
Three e2e tests set their own trap ... EXIT to clean up a temporary constraints file, which silently replaces the on_exit EXIT handler registered by common.sh.
Details
common.sh:66 registers:
trap on_exit EXIT SIGINT SIGTERM
This handler stops the wheel server (kill "$HTTP_SERVER_PID") if one was started.
Three tests then register their own EXIT trap after sourcing common.sh:
e2e/test_bootstrap_constraints.sh:14
e2e/test_bootstrap_multiple_versions.sh:13
e2e/test_bootstrap_conflicting_requirements.sh:15
trap "rm -f $constraints_file" EXIT
In bash, trap replaces the previous handler for a given signal rather than appending to it. This means on_exit will not run on EXIT for these tests.
Current impact
Low — none of these three tests call start_local_wheel_server, so HTTP_SERVER_PID is empty and on_exit is a no-op. But if someone adds a wheel server to any of these tests, the server process would leak.
There is also a minor quoting issue: $constraints_file is expanded at trap registration time (double quotes) rather than at exit time. This works since the variable is set before the trap and never changes, but single quotes would be more robust.
Affected files
e2e/test_bootstrap_constraints.sh:14
e2e/test_bootstrap_multiple_versions.sh:13
e2e/test_bootstrap_conflicting_requirements.sh:15
Summary
Three e2e tests set their own
trap ... EXITto clean up a temporary constraints file, which silently replaces theon_exitEXIT handler registered bycommon.sh.Details
common.sh:66registers:trap on_exit EXIT SIGINT SIGTERMThis handler stops the wheel server (
kill "$HTTP_SERVER_PID") if one was started.Three tests then register their own EXIT trap after sourcing
common.sh:e2e/test_bootstrap_constraints.sh:14e2e/test_bootstrap_multiple_versions.sh:13e2e/test_bootstrap_conflicting_requirements.sh:15In bash,
trapreplaces the previous handler for a given signal rather than appending to it. This meanson_exitwill not run on EXIT for these tests.Current impact
Low — none of these three tests call
start_local_wheel_server, soHTTP_SERVER_PIDis empty andon_exitis a no-op. But if someone adds a wheel server to any of these tests, the server process would leak.There is also a minor quoting issue:
$constraints_fileis expanded at trap registration time (double quotes) rather than at exit time. This works since the variable is set before the trap and never changes, but single quotes would be more robust.Affected files
e2e/test_bootstrap_constraints.sh:14e2e/test_bootstrap_multiple_versions.sh:13e2e/test_bootstrap_conflicting_requirements.sh:15