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

Flaky Test: ShuffleBufferManagerTest#bufferSizeTest #408

Closed
2 of 3 tasks
zuston opened this issue Dec 13, 2022 · 4 comments · Fixed by #657
Closed
2 of 3 tasks

Flaky Test: ShuffleBufferManagerTest#bufferSizeTest #408

zuston opened this issue Dec 13, 2022 · 4 comments · Fixed by #657

Comments

@zuston
Copy link
Member

zuston commented Dec 13, 2022

Code of Conduct

Search before asking

  • I have searched in the issues and found no similar issues.

Describe the flaky test

[INFO] Running org.apache.uniffle.server.buffer.ShuffleBufferManagerTest
Error:  Tests run: 8, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 3.473 s <<< FAILURE! - in org.apache.uniffle.server.buffer.ShuffleBufferManagerTest
Error:  bufferSizeTest  Time elapsed: 0.535 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <0> but was: <288>
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
	at org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:166)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:161)
	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:628)
	at org.apache.uniffle.server.buffer.ShuffleBufferManagerTest.bufferSizeTest(ShuffleBufferManagerTest.java:428)

Actions URL

https://github.com/apache/incubator-uniffle/actions/runs/3681854053/jobs/6228951081

Parent issue

#1733

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@xianjingfeng
Copy link
Member

@zuston ShuffleBufferManagerTest#waitForFlush seems not applicable in this UT. because updateCommittedBlockIds is invoked before event.doCleanup(). I have no good idea to fix it. Do you have any good ideas?

if (writeSuccess) {
updateCommittedBlockIds(event.getAppId(), event.getShuffleId(), blocks);
ShuffleServerMetrics.incStorageSuccessCounter(storage.getStorageHost());
break;
} else {
event.increaseRetryTimes();
ShuffleServerMetrics.incStorageRetryCounter(storage.getStorageHost());
}
} catch (Throwable throwable) {
// just log the error, don't throw the exception and stop the flush thread
LOG.error("Exception happened when process flush shuffle data for {}", event, throwable);
event.increaseRetryTimes();
}
}
if (event.getRetryTimes() > retryMax) {
LOG.error("Failed to write data for {} in {} times, shuffle data will be lost", event, retryMax);
if (event.getUnderStorage() != null) {
ShuffleServerMetrics.incStorageFailedCounter(event.getUnderStorage().getStorageHost());
}
}
event.doCleanup();

@zuston
Copy link
Member Author

zuston commented Feb 22, 2023

@jerqi
Copy link
Contributor

jerqi commented Feb 22, 2023

@zuston ShuffleBufferManagerTest#waitForFlush seems not applicable in this UT. because updateCommittedBlockIds is invoked before event.doCleanup(). I have no good idea to fix it. Do you have any good ideas?

if (writeSuccess) {
updateCommittedBlockIds(event.getAppId(), event.getShuffleId(), blocks);
ShuffleServerMetrics.incStorageSuccessCounter(storage.getStorageHost());
break;
} else {
event.increaseRetryTimes();
ShuffleServerMetrics.incStorageRetryCounter(storage.getStorageHost());
}
} catch (Throwable throwable) {
// just log the error, don't throw the exception and stop the flush thread
LOG.error("Exception happened when process flush shuffle data for {}", event, throwable);
event.increaseRetryTimes();
}
}
if (event.getRetryTimes() > retryMax) {
LOG.error("Failed to write data for {} in {} times, shuffle data will be lost", event, retryMax);
if (event.getUnderStorage() != null) {
ShuffleServerMetrics.incStorageFailedCounter(event.getUnderStorage().getStorageHost());
}
}
event.doCleanup();

If this test don't have good solution, we can disable this test first to reduce the failure of CI. Or we can rewrite this test.

@zuston
Copy link
Member Author

zuston commented Feb 25, 2023

How about sleep a while to wait event.doCleanUp being invoked?

zuston added a commit to zuston/incubator-uniffle that referenced this issue Feb 25, 2023
zuston added a commit that referenced this issue Feb 27, 2023
…ferSizeTest (#657)

### What changes were proposed in this pull request?

Fix memory check failure due to the execution sequence in ShuffleBufferManagerTest#bufferSizeTest

### Why are the changes needed?

Flaky test fix: #408

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Existing UTs
zuston added a commit that referenced this issue Mar 7, 2023
…ferSizeTest (#657)

### What changes were proposed in this pull request?

Fix memory check failure due to the execution sequence in ShuffleBufferManagerTest#bufferSizeTest

### Why are the changes needed?

Flaky test fix: #408

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Existing UTs
advancedxy pushed a commit to advancedxy/incubator-uniffle that referenced this issue Mar 21, 2023
…st#bufferSizeTest (apache#657)

### What changes were proposed in this pull request?

Fix memory check failure due to the execution sequence in ShuffleBufferManagerTest#bufferSizeTest

### Why are the changes needed?

Flaky test fix: apache#408

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Existing UTs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants