javeme commented on code in PR #287:
URL:
https://github.com/apache/incubator-hugegraph-computer/pull/287#discussion_r1403392735
##########
computer-test/src/main/java/org/apache/hugegraph/computer/k8s/MiniKubeTest.java:
##########
@@ -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);
Review Comment:
should we also assert the returned value of `cancelJob()`
##########
computer-test/src/main/java/org/apache/hugegraph/computer/k8s/MiniKubeTest.java:
##########
@@ -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);
Review Comment:
there is still an error:
```java
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
```
##########
computer-test/src/main/java/org/apache/hugegraph/computer/k8s/MiniKubeTest.java:
##########
@@ -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);
Review Comment:
try to sleep() both before and after cancelJob?
```java
sleep(1s)
cancelJob()
sleep(2s)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]