Fix the Github workflow tests - #72
Merged
Merged
Conversation
Signed-off-by: David Dale <daviddale@meta.com>
Signed-off-by: David Dale <daviddale@meta.com>
Signed-off-by: David Dale <daviddale@meta.com>
avidale
marked this pull request as ready for review
January 15, 2025 10:40
antoine-tran
self-requested a review
January 15, 2025 10:46
antoine-tran
approved these changes
Jan 15, 2025
Merged
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.
Why ?
The tests seem to be falling on
main, see e.g. #71.For the global mining test, the problem seems to be with the interaction of the test and the dependencies (maybe pytest-asyncio?), because the code itself has not changed since long ago.
How ?
The falling test
stopes/pipelines/tests/test_global_mining.pywas complaining about not having access to an event loop in some of its parametrized runs; apparently, the event gets closed after the first test run.Setting its asyncio test scope to
sessionseems to fix the problem. I also remove a deprecation warning by setting explicitlyasyncio_default_fixture_loop_scope = "session"in the project configuration.Test plan
Use the automatic Github workflow to run the tests.
Before the changes (the first commit,
a dummy commit): there is a warning on the top of the tests logPytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset, and the global mining test is failing withRuntimeError: There is no current event loop in thread 'MainThread'..After the changes: the warning is gone and the tests are passing.