-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapt tests to reuse Orchestrator #567
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small questions about intent that I wanted to write down so that I could cover them later while I pick up this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome! And I really like how it was implemented. I have a couple questions and there's a test file that needs some love, but that's it!
tests/test_fixtures.py
Outdated
def test_single_db_fixture(single_db): | ||
experiment = Experiment("test_single_fixture") | ||
experiment.reconnect_orchestrator(single_db.checkpoint_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incomplete test? And if we're testing one of the fixtures, we might want to test all of them!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhhh... good question! I've never written testing code for testing code before. I'll defer to @ashao on this one for intention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How meta do we want to go? But yes the intention of this was to make sure that fixture works as expected. I'm imagining us bashing our head against something related to the fixture and just being able to do:
pytest test_fixtures.py::test_single_db_fixture
and save us some time down the line. Happy to be argued down, but in general I think it's not crazy to have a some sanity checking of testing code since it helps to debug tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I definitely don't hate the idea of being able to sanity check that the fixtures are working as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is like a dream come true. I can't wait for my speedy test results.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #567 +/- ##
===========================================
- Coverage 84.34% 78.71% -5.63%
===========================================
Files 67 67
Lines 4637 4642 +5
===========================================
- Hits 3911 3654 -257
- Misses 726 988 +262
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, will take a second pass in the morning! Just some super small comments
@@ -102,7 +102,7 @@ Detailed Notes | |||
Torch will unconditionally try to link in this library, however | |||
fails because the linking flags are incorrect. | |||
([SmartSim-PR538](https://github.com/CrayLabs/SmartSim/pull/538)) | |||
- Change type_extension and pydantic versions in readthedocs | |||
- Change typing\_extensions and pydantic versions in readthedocs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice two updates to the Detailed Notes section but one update to the Description!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the change to "Description" and one of the "Detailed Notes" edits were just minor typo/grammar things.
The actual "Detailed Note" I added I figured fell under the category of "Minor enhancements to test suite" which is already listed in the "Description" section, so I just added something the details. LMK if you think this warrants its on entry in the "Description" and I can add something there!!
Note that Al noted a defect which causes cascading failures if the database was stopped on purpose or because of a database error. A fix is coming in |
a165c25
to
09aa6f3
Compare
…atch test description
Remove the `is_active` check in the controller as it was leading to node promotion errors within `redispy` when checking the status of a batch launched orchestrator.
3640355
to
3694737
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!
Tests which needed to launch an Orchestrator were spinning up and shutting down their own instances. This led to a number of cases where a single test failing would cascade into failures of other tests. Additionally, this also meant that a significant amount of time in the tests was spent waiting for Orchestrators to launch.
This PR adds a session-scoped fixture that returns an Orchestrator. Most tests which use an Orchestrator have been updated to use this fixture; the remaining for various reasons still need to spin up their own (for example the multiple database tests need to have a named Orchestrator).
This PR is not 100% complete with the following to be done