-
Notifications
You must be signed in to change notification settings - Fork 41
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
Fix MiniKubeTest.testJobCancelled #287
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #287 +/- ##
============================================
+ Coverage 85.03% 85.12% +0.08%
- Complexity 3246 3280 +34
============================================
Files 345 349 +4
Lines 12298 12406 +108
Branches 1102 1113 +11
============================================
+ Hits 10458 10560 +102
- Misses 1315 1316 +1
- Partials 525 530 +5 ☔ View full report in Codecov by Sentry. |
.github/workflows/ci.yml
Outdated
@@ -45,7 +45,7 @@ jobs: | |||
with: | |||
path: ~/hadoop-3.3.2.tar.gz | |||
key: ${{ runner.os }}--hadoop | |||
restore-keys: ${{ runner.os }}-hadoop | |||
restore-keys: ${{ runner.os }}--hadoop |
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.
Unexpected modifications?
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.
Revert
@@ -246,6 +246,7 @@ public void testJobCancelled() { | |||
jobState.jobStatus(JobStatus.INITIALIZING); | |||
Mockito.verify(jobObserver, Mockito.timeout(15000L).atLeast(1)) | |||
.onJobStateChanged(Mockito.eq(jobState)); | |||
Mockito.clearInvocations(jobObserver); | |||
|
|||
this.driver.cancelJob(jobId, params); |
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.
should we also assert the returned value of cancelJob()
@@ -246,6 +246,7 @@ public void testJobCancelled() { | |||
jobState.jobStatus(JobStatus.INITIALIZING); | |||
Mockito.verify(jobObserver, Mockito.timeout(15000L).atLeast(1)) | |||
.onJobStateChanged(Mockito.eq(jobState)); | |||
Mockito.clearInvocations(jobObserver); |
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.
there is still an error:
Error: Failures:
Error: MiniKubeTest.testJobCancelled:258
Argument(s) are different! Wanted:
jobObserver.onJobStateChanged(
org.apache.hugegraph.computer.driver.DefaultJobState@393365e0
);
-> at org.apache.hugegraph.computer.k8s.MiniKubeTest.testJobCancelled(MiniKubeTest.java:258)
Actual invocations have different arguments:
jobObserver.onJobStateChanged(
org.apache.hugegraph.computer.driver.DefaultJobState@3089df23
);
-> at org.apache.hugegraph.computer.k8s.driver.KubernetesDriver$1.eventReceived(KubernetesDriver.java:344)
jobObserver.onJobStateChanged(
org.apache.hugegraph.computer.driver.DefaultJobState@3089df23
);
-> at org.apache.hugegraph.computer.k8s.driver.KubernetesDriver$1.eventReceived(KubernetesDriver.java:344)
[INFO]
Error: Tests run: 565, Failures: 1, Errors: 0, Skipped: 0
@@ -246,6 +246,7 @@ public void testJobCancelled() { | |||
jobState.jobStatus(JobStatus.INITIALIZING); | |||
Mockito.verify(jobObserver, Mockito.timeout(15000L).atLeast(1)) | |||
.onJobStateChanged(Mockito.eq(jobState)); | |||
Mockito.clearInvocations(jobObserver); | |||
|
|||
this.driver.cancelJob(jobId, params); | |||
|
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.
try to sleep() both before and after cancelJob?
sleep(1s)
cancelJob()
sleep(2s)
Purpose of the PR
Main Changes
Trying to fix MiniKubeTest.testJobCancelled
Verifying these changes
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODO
Doc - Done
Doc - No Need