You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uniffle.apache.org by ck...@apache.org on 2023/01/17 03:27:50 UTC
[incubator-uniffle] branch branch-0.6 updated: [ISSUE-472] Fix Flaky Test: LocalFileServerReadHandlerTest#testDataInconsistent (#473)
This is an automated email from the ASF dual-hosted git repository.
ckj pushed a commit to branch branch-0.6
in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git
The following commit(s) were added to refs/heads/branch-0.6 by this push:
new aeb550b6 [ISSUE-472] Fix Flaky Test: LocalFileServerReadHandlerTest#testDataInconsistent (#473)
aeb550b6 is described below
commit aeb550b66e7a5da55ec328aa57049ac15a7b5ef8
Author: Junfan Zhang <zu...@apache.org>
AuthorDate: Thu Jan 12 15:49:58 2023 +0800
[ISSUE-472] Fix Flaky Test: LocalFileServerReadHandlerTest#testDataInconsistent (#473)
### What changes were proposed in this pull request?
1. Reset the static variable to fix LocalFileServerReadHandlerTest#testDataInconsistent
### Why are the changes needed?
Fix flaky test
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
1. Existing UTs
---
.../apache/uniffle/storage/handler/impl/LocalFileHandlerTestBase.java | 4 ++++
.../uniffle/storage/handler/impl/LocalFileServerReadHandlerTest.java | 2 ++
2 files changed, 6 insertions(+)
diff --git a/storage/src/test/java/org/apache/uniffle/storage/handler/impl/LocalFileHandlerTestBase.java b/storage/src/test/java/org/apache/uniffle/storage/handler/impl/LocalFileHandlerTestBase.java
index ae7f0541..e0e83fc3 100644
--- a/storage/src/test/java/org/apache/uniffle/storage/handler/impl/LocalFileHandlerTestBase.java
+++ b/storage/src/test/java/org/apache/uniffle/storage/handler/impl/LocalFileHandlerTestBase.java
@@ -44,6 +44,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class LocalFileHandlerTestBase {
private static AtomicLong ATOMIC_LONG = new AtomicLong(0L);
+ public static void reset() {
+ ATOMIC_LONG = new AtomicLong(0L);
+ }
+
public static void writeTestData(
ShuffleWriteHandler writeHandler,
int num, int length,
diff --git a/storage/src/test/java/org/apache/uniffle/storage/handler/impl/LocalFileServerReadHandlerTest.java b/storage/src/test/java/org/apache/uniffle/storage/handler/impl/LocalFileServerReadHandlerTest.java
index d25f44f4..599df3ce 100644
--- a/storage/src/test/java/org/apache/uniffle/storage/handler/impl/LocalFileServerReadHandlerTest.java
+++ b/storage/src/test/java/org/apache/uniffle/storage/handler/impl/LocalFileServerReadHandlerTest.java
@@ -42,6 +42,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class LocalFileServerReadHandlerTest {
@Test
public void testDataInconsistent() throws Exception {
+ LocalFileHandlerTestBase.reset();
+
Map<Long, byte[]> expectedData = Maps.newHashMap();
int expectTotalBlockNum = 4;
int blockSize = 7;