This is an automated email from the ASF dual-hosted git repository.

ckj pushed a commit to branch branch-0.7
in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git


The following commit(s) were added to refs/heads/branch-0.7 by this push:
     new 32da3922 [MINOR] test: fix static field initialized before TempDir 
field injected (#707)
32da3922 is described below

commit 32da3922c75f41b9a77d4e5467ed98baf78fa9a3
Author: advancedxy <[email protected]>
AuthorDate: Fri Mar 10 19:14:06 2023 +0800

    [MINOR] test: fix static field initialized before TempDir field injected 
(#707)
    
    ### What changes were proposed in this pull request?
    fix UTs
    
    ### Why are the changes needed?
    Makes integration tests passed on local machines
    
    ### Does this PR introduce _any_ user-facing change?
    No.
    
    ### How was this patch tested?
    Manually verified.
---
 .../java/org/apache/uniffle/test/DiskErrorToleranceTest.java     | 9 +++++----
 .../org/apache/uniffle/test/HealthCheckCoordinatorGrpcTest.java  | 6 +++---
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git 
a/integration-test/common/src/test/java/org/apache/uniffle/test/DiskErrorToleranceTest.java
 
b/integration-test/common/src/test/java/org/apache/uniffle/test/DiskErrorToleranceTest.java
index f7916533..e00882dc 100644
--- 
a/integration-test/common/src/test/java/org/apache/uniffle/test/DiskErrorToleranceTest.java
+++ 
b/integration-test/common/src/test/java/org/apache/uniffle/test/DiskErrorToleranceTest.java
@@ -56,14 +56,15 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 public class DiskErrorToleranceTest extends ShuffleReadWriteBase {
   private ShuffleServerGrpcClient shuffleServerClient;
 
-  @TempDir private static File serverTmpDir;
-  private static File data1 = new File(serverTmpDir, "data1");
-  private static File data2 = new File(serverTmpDir, "data2");
+  private static File data1;
+  private static File data2;
   private List<ShuffleServerInfo> shuffleServerInfo =
       Lists.newArrayList(new ShuffleServerInfo("127.0.0.1-20001", LOCALHOST, 
SHUFFLE_SERVER_PORT));
 
   @BeforeAll
-  public static void setupServers() throws Exception {
+  public static void setupServers(@TempDir File serverTmpDir) throws Exception 
{
+    data1 = new File(serverTmpDir, "data1");
+    data2 = new File(serverTmpDir, "data2");
     CoordinatorConf coordinatorConf = getCoordinatorConf();
     createCoordinatorServer(coordinatorConf);
     ShuffleServerConf shuffleServerConf = getShuffleServerConf();
diff --git 
a/integration-test/common/src/test/java/org/apache/uniffle/test/HealthCheckCoordinatorGrpcTest.java
 
b/integration-test/common/src/test/java/org/apache/uniffle/test/HealthCheckCoordinatorGrpcTest.java
index 96832b9b..8338aa92 100644
--- 
a/integration-test/common/src/test/java/org/apache/uniffle/test/HealthCheckCoordinatorGrpcTest.java
+++ 
b/integration-test/common/src/test/java/org/apache/uniffle/test/HealthCheckCoordinatorGrpcTest.java
@@ -46,12 +46,12 @@ import static org.junit.jupiter.api.Assertions.fail;
 
 public class HealthCheckCoordinatorGrpcTest extends CoordinatorTestBase  {
 
-  @TempDir private static File serverTmpDir;
-  private static File tempDataFile = new File(serverTmpDir, "data");
+  private static File tempDataFile;
   private static int writeDataSize;
 
   @BeforeAll
-  public static void setupServers() throws Exception {
+  public static void setupServers(@TempDir File serverTmpDir) throws Exception 
{
+    tempDataFile = new File(serverTmpDir, "data");
     File data1 = new File(serverTmpDir, "data1");
     data1.mkdirs();
     File data2 = new File(serverTmpDir, "data2");

Reply via email to