Fix race condition in Python tests by disabling async ECL output#6491
Merged
akva2 merged 2 commits intoOPM:masterfrom Sep 23, 2025
Merged
Fix race condition in Python tests by disabling async ECL output#6491akva2 merged 2 commits intoOPM:masterfrom
akva2 merged 2 commits intoOPM:masterfrom
Conversation
Add --enable-async-ecl-output=false to all Python simulator tests to prevent race condition between async file writing tasklets and pushd context manager. Problem: - Tests use pushd() to change directory before running simulations - Simulator dispatches async tasklets to write ECL output files - pushd context exits before async writes complete - Tasklets write files in wrong directory (build/python/ instead of test_data/) - Causes confusing error messages and misplaced output files Solution: - Disable async ECL output during tests for deterministic behavior - Files now created in correct locations within test_data/ directories - Eliminates "Can not open EclFile" errors in logs - Makes test execution predictable and synchronous
Contributor
Author
|
jenkins build this please |
Move simulator instantiation to factory functions that automatically disable async ECL output. This prevents future contributors from forgetting the --enable-async-ecl-output=false flag. - Add create_black_oil_simulator/create_gas_water_simulator to pytest_common - Define ENABLE_ASYNC_ECL_OUTPUT_FLAG constant - Update all tests to use factory functions - No functional changes, pure refactoring
Contributor
Author
|
jenkins build this please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Thanks to @akva2 for reporting this issue: Sometimes running Python unit tests left misplaced output files (like
SPE1CASE2_GASWATER.UNRST) and error message like:The problem is that:
pushd()to change directory before running simulationsbuild/python/instead ofbuild/python/test_data/<case>/)This PR adds
--enable-async-ecl-output=falseto all Python simulator tests to prevent race condition between async file writing tasklets and pushd context manager.