-
Notifications
You must be signed in to change notification settings - Fork 140
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
Refactor TrainingJobRouteDecisionInfo test to use KNNTestCase #1374
Conversation
Recently, we have seen that TrainingJobRouteDecisionInfoTransportActionTests has been having failures on Windows. The failures are related to an unintialized cluster state. This does not have anything to do with the test itself. Most likely, it is the result of state dependence that happens with KNNSingleNodeTestCase. This change refactors the class to use mocks and a lighter weight base class, KNNTestCase. Signed-off-by: John Mazanec <[email protected]>
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!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1374 +/- ##
============================================
- Coverage 85.10% 85.07% -0.04%
Complexity 1254 1254
============================================
Files 163 163
Lines 5104 5104
Branches 477 477
============================================
- Hits 4344 4342 -2
- Misses 554 556 +2
Partials 206 206 ☔ View full report in Codecov by Sentry. |
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
Waiting for k-NN build to be completed. |
Recently, we have seen that TrainingJobRouteDecisionInfoTransportActionTests has been having failures on Windows. The failures are related to an unintialized cluster state. This does not have anything to do with the test itself. Most likely, it is the result of state dependence that happens with KNNSingleNodeTestCase. This change refactors the class to use mocks and a lighter weight base class, KNNTestCase. Signed-off-by: John Mazanec <[email protected]> (cherry picked from commit 5c24d99)
Description
Recently, we have seen that TrainingJobRouteDecisionInfoTransportActionTests has been having failures on Windows (for example: https://github.com/jmazanec15/k-NN-1/actions/runs/7415192445/job/20177850505). The failures are related to an unintialized cluster state tryiing to be accessed after calling training. Still not sure why the cluster state is null after the test starts, but this does not have anything to do with the test itself.
Most likely, the flakiness is the result of state sharing that happens with KNNSingleNodeTestCase. KNNSingleNodeTestCase inherits from OpenSearchSingleNodeTestCase which will start a node as a part of running each test. OpenSearchSingleNodeTestCase is unnecessary for this test case where we just want to validate that a transport action can read the correct job count on the node. This change refactors the class to use mocks and a lighter weight base class, KNNTestCase. In general, we should always prefer KNNTestCase over KNNSingleNodeTestCase.
Issues Resolved
#1368
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.