Skip to content

[#1219] fix(test): Fix the flaky test WriteAndReadMetricsTest - #1235

Merged
zuston merged 1 commit into
apache:masterfrom
summaryzb:fix_read_metric
Oct 14, 2023
Merged

[#1219] fix(test): Fix the flaky test WriteAndReadMetricsTest#1235
zuston merged 1 commit into
apache:masterfrom
summaryzb:fix_read_metric

Conversation

@summaryzb

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Add a little wait time before verify the result

Why are the changes needed?

Usually this happens in spark2.3 integration test

Error:  Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 31.317 s <<< FAILURE! - in org.apache.uniffle.test.WriteAndReadMetricsTest
Error:  test  Time elapsed: 28.47 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <55> but was: <54>
	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:182)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1141)
	at org.apache.uniffle.test.SparkIntegrationTestBase.verifyTestResult(SparkIntegrationTestBase.java:130)
	at org.apache.uniffle.test.SparkIntegrationTestBase.run(SparkIntegrationTestBase.java:67)
	at org.apache.uniffle.test.WriteAndReadMetricsTest.test(WriteAndReadMetricsTest.java:40)

Inspired by SPARK-24415
It might be an order of events type problem, taskEndEvent trigger the metric updates, while stageCompletion trigger the stageData updates

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Run local test in a loop of 100 times without a failure

@zuston zuston changed the title [MINOR] test: Fix the flaky test WriteAndReadMetricsTest [#1219] fix(test): Fix the flaky test WriteAndReadMetricsTest Oct 14, 2023

@zuston zuston left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm. Thanks @summaryzb

@zuston
zuston merged commit b724a31 into apache:master Oct 14, 2023
@summaryzb
summaryzb deleted the fix_read_metric branch October 14, 2023 08:48
@zuston zuston mentioned this pull request Oct 16, 2023
3 tasks
roryqi pushed a commit that referenced this pull request Oct 17, 2023
### What changes were proposed in this pull request?
Add a little wait time before verify the result

### Why are the changes needed?
Usually this happens in spark2.3 integration test
```
Error:  Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 31.317 s <<< FAILURE! - in org.apache.uniffle.test.WriteAndReadMetricsTest
Error:  test  Time elapsed: 28.47 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <55> but was: <54>
	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:182)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1141)
	at org.apache.uniffle.test.SparkIntegrationTestBase.verifyTestResult(SparkIntegrationTestBase.java:130)
	at org.apache.uniffle.test.SparkIntegrationTestBase.run(SparkIntegrationTestBase.java:67)
	at org.apache.uniffle.test.WriteAndReadMetricsTest.test(WriteAndReadMetricsTest.java:40)
```
Inspired by [SPARK-24415](https://issues.apache.org/jira/browse/SPARK-24415)
It might be an order of events type problem, taskEndEvent trigger the metric updates, while stageCompletion trigger the stageData updates

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

### How was this patch tested?
Run local test in a loop of 100 times without a failure
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.

2 participants