Fix Error 143 (SIGTERM timeout) in CI tests by adding proper environment setup and timeouts #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
PR ORNL#378 was experiencing continuous test failures with Error 143 (SIGTERM), indicating that tests were being killed by the CI system for exceeding time limits. While
qm9.pyandmd17.pyexample scripts were already fixed to respect theNUM_EPOCHSenvironment variable, several test functions were not properly configuring the environment when executing these scripts.Root Cause
The issue occurred because:
test_examples.py(pytest_examples_energy_gps,pytest_examples_grad_forces) andtest_forces_equivariant.py(pytest_examples) were calling example scripts without setting critical environment variables likeNUM_EPOCHS=1LennardJones.pydidn't respect theNUM_EPOCHSenvironment variable, unlike other example scriptstest_examples.pycontained duplicate code from an earlier functionSolution
This PR fixes all identified issues with minimal, surgical changes:
1. Fixed Test Functions (4 total)
Added proper environment setup and explicit timeouts to:
pytest_examples_energy_gpsintest_examples.pypytest_examples_grad_forcesintest_examples.pypytest_examplesintest_forces_equivariant.pyEach test now sets:
2. Updated LennardJones.py
Added
NUM_EPOCHSenvironment variable support to match the pattern used inqm9.pyandmd17.py:3. Code Cleanup
Removed duplicate code from
pytest_examples_energy_equiformer_group2function (lines 176-199 intest_examples.py).Impact
Performance Improvements:
Reliability:
Files Changed
tests/test_examples.py(+30, -24 lines) - Fixed 3 test functions, removed duplicate codetests/test_forces_equivariant.py(+16, -1 lines) - Fixed 1 test functionexamples/LennardJones/LennardJones.py(+6 lines) - Added NUM_EPOCHS supportTotal: +52 insertions, -27 deletions
Testing
All changes have been validated:
NUM_EPOCHSenvironment variableThis fix follows the same pattern that was previously applied to EquiformerV2 tests and should resolve the timeout issues in PR ORNL#378.
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.