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

aajisaka pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-3.3 by this push:
     new 3526569  YARN-10788. TestCsiClient fails (#3989)
3526569 is described below

commit 352656999ff181ff5d0e2e4d58f2c23710e61c42
Author: Akira Ajisaka <[email protected]>
AuthorDate: Tue Feb 15 01:13:13 2022 +0900

    YARN-10788. TestCsiClient fails (#3989)
    
    Create unix domain socket in java.io.tmpdir instead of
    test.build.dir to avoid 'File name too long' error.
    
    Reviewed-by: Ayush Saxena <[email protected]>
    (cherry picked from commit 7fd90cdcbea65bf8d0d1e609ee0331026b381182)
---
 .../java/org/apache/hadoop/yarn/csi/client/TestCsiClient.java | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-csi/src/test/java/org/apache/hadoop/yarn/csi/client/TestCsiClient.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-csi/src/test/java/org/apache/hadoop/yarn/csi/client/TestCsiClient.java
index b60d5cd..ffbfa46 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-csi/src/test/java/org/apache/hadoop/yarn/csi/client/TestCsiClient.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-csi/src/test/java/org/apache/hadoop/yarn/csi/client/TestCsiClient.java
@@ -20,13 +20,14 @@ package org.apache.hadoop.yarn.csi.client;
 
 import csi.v0.Csi;
 import org.apache.commons.io.FileUtils;
-import org.apache.hadoop.test.GenericTestUtils;
 import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.Assume;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.io.File;
 import java.io.IOException;
@@ -36,19 +37,21 @@ import java.nio.file.Files;
  * Test class for CSI client.
  */
 public class TestCsiClient {
-
+  private static final Logger LOG = 
LoggerFactory.getLogger(TestCsiClient.class);
   private static File testRoot = null;
   private static String domainSocket = null;
   private static FakeCsiDriver driver = null;
 
   @BeforeClass
   public static void setUp() throws IOException {
-    File testDir = GenericTestUtils.getTestDir();
+    // Use /tmp to fix bind failure caused by the long file name
+    File tmpDir = new File(System.getProperty("java.io.tmpdir"));
     testRoot = Files
-        .createTempDirectory(testDir.toPath(), "test").toFile();
+        .createTempDirectory(tmpDir.toPath(), "test").toFile();
     File socketPath = new File(testRoot, "csi.sock");
     FileUtils.forceMkdirParent(socketPath);
     domainSocket = "unix://" + socketPath.getAbsolutePath();
+    LOG.info("Create unix domain socket: {}", domainSocket);
     driver = new FakeCsiDriver(domainSocket);
   }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to