Skip to content

Commit becfaa4

Browse files
jlarkin09claude
andcommitted
fix(e2e): chain on_exit in constraint test EXIT traps
The three constraint e2e tests registered their own trap ... EXIT which silently replaced the on_exit handler from common.sh. Chain on_exit in each trap and switch to single quotes so $constraints_file is expanded at exit time rather than registration time. Closes: #1062 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Justin Larkin <jlarkin@redhat.com> Made-with: Cursor
1 parent 05c65ab commit becfaa4

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

e2e/test_bootstrap_conflicting_requirements.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ source "$SCRIPTDIR/common.sh"
1212

1313
# expected pbr version
1414
constraints_file=$(mktemp)
15-
trap "rm -f $constraints_file" EXIT
15+
trap 'rm -f "$constraints_file"; on_exit' EXIT
1616
echo "pbr==7.0.3" > "$constraints_file"
1717

1818
# passing settings to bootstrap but should have 0 effect on it

e2e/test_bootstrap_constraints.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1111
source "$SCRIPTDIR/common.sh"
1212

1313
constraints_file=$(mktemp)
14-
trap "rm -f $constraints_file" EXIT
14+
trap 'rm -f "$constraints_file"; on_exit' EXIT
1515
echo "stevedore==4.0.0" > "$constraints_file"
1616

1717
# passing settings to bootstrap but should have 0 effect on it

e2e/test_bootstrap_multiple_versions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ source "$SCRIPTDIR/common.sh"
1010
# Create constraints file with generous ranges to test multiple versions
1111
# of build dependencies (not just top-level packages)
1212
constraints_file=$(mktemp)
13-
trap "rm -f $constraints_file" EXIT
13+
trap 'rm -f "$constraints_file"; on_exit' EXIT
1414
cat > "$constraints_file" <<EOF
1515
# Allow a range of flit-core versions to verify multiple-versions works for dependencies
1616
flit-core>=3.9,<3.12

0 commit comments

Comments
 (0)