Skip to content
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

Closed
wants to merge 4 commits into from
Closed

Conversation

coderzc
Copy link
Member

@coderzc coderzc commented Nov 22, 2023

Purpose of the PR

Main Changes

Trying to fix MiniKubeTest.testJobCancelled

Verifying these changes

  • Trivial rework / code cleanup without any test coverage. (No Need)
  • Already covered by existing tests, such as (please modify tests here).
  • Need tests and can be verified as follows.

Does this PR potentially affect the following parts?

  • Nope
  • Dependencies (add/update license info)
  • Modify configurations
  • The public API
  • Other affects (typed here)

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need

Copy link

codecov bot commented Nov 22, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (ff85e34) 85.03% compared to head (f0393ce) 85.12%.
Report is 3 commits behind head on master.

❗ Current head f0393ce differs from pull request most recent head 01eb1aa. Consider uploading reports for the commit 01eb1aa to get more accurate results

Files Patch % Lines
...egraph/computer/algorithm/sampling/RandomWalk.java 92.06% 2 Missing and 3 partials ⚠️
...computer/algorithm/sampling/RandomWalkMessage.java 94.11% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected modifications?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert

@coderzc coderzc marked this pull request as draft November 22, 2023 12:05
@@ -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);
Copy link
Contributor

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);
Copy link
Contributor

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);

Copy link
Contributor

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)

@coderzc coderzc closed this Dec 1, 2023
@imbajin imbajin deleted the fix_testJobCancelled branch December 21, 2023 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[flaky-test] MiniKubeTest.testJobCancelled
3 participants