Skip to content

fix(e2e): trap in constraint tests replaces common.sh on_exit EXIT handler #1062

@LalatenduMohanty

Description

@LalatenduMohanty

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingci

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions