Skip to content

Conversation

@mkoura
Copy link
Collaborator

@mkoura mkoura commented Dec 18, 2025

Refactor trap usage in .github/regression.sh to use a variable for the error trap string, ensuring proper quoting and shellcheck compliance. Enhance cleanup logic to ignore further interrupts and errors during cleanup, and disable unnecessary traps after tests finish.

In .github/run_tests.sh, add --foreground to the timeout command to ensure proper signal handling when running pytest with a session timeout.

@mkoura mkoura requested a review from saratomaz as a code owner December 18, 2025 12:44
Refactor trap usage in .github/regression.sh to use a variable for the error
trap string, ensuring proper quoting and shellcheck compliance. Enhance
cleanup logic to ignore further interrupts and errors during cleanup, and
disable unnecessary traps after tests finish.

In .github/run_tests.sh, add --foreground to the timeout command to ensure
proper signal handling when running pytest with a session timeout.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves trap handling and signal management in CI scripts by refactoring the error trap implementation and enhancing cleanup robustness. However, the refactoring introduces a bug where $LINENO is expanded immediately when setting traps rather than when errors occur.

Key Changes

  • Added --foreground flag to timeout command for proper signal propagation to pytest
  • Refactored ERR trap to use a variable (basic_err_string) for consistency
  • Enhanced cleanup logic to ignore interrupts and errors during cleanup operations
  • Protected MON_PID variable reference with parameter expansion

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/run_tests.sh Adds --foreground flag to timeout command to ensure proper signal handling for pytest subprocess
.github/regression.sh Refactors ERR trap using variable, enhances cleanup interrupt handling, protects MON_PID reference, and manages trap states throughout script lifecycle

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mkoura mkoura merged commit 4b45007 into master Dec 18, 2025
7 checks passed
@mkoura mkoura deleted the fix_signal_handling branch December 18, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants