Skip to content

Commit eb5df0f

Browse files
fix test
1 parent 3217291 commit eb5df0f

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemLease.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ public class ITestAzureBlobFileSystemLease extends AbstractAbfsIntegrationTest {
7171
private static final String TEST_FILE = "testfile";
7272
private final boolean isHNSEnabled;
7373
private static final int TEST_BYTES = 20;
74+
private static final String PARALLEL_ACCESS = "Parallel access to the create path "
75+
+ "detected";
7476

7577
public ITestAzureBlobFileSystemLease() throws Exception {
7678
super();
@@ -151,14 +153,15 @@ public void testTwoCreate() throws Exception {
151153
fs.mkdirs(testFilePath.getParent());
152154

153155
try (FSDataOutputStream out = fs.create(testFilePath)) {
154-
LambdaTestUtils.intercept(IOException.class, isHNSEnabled ? ERR_PARALLEL_ACCESS_DETECTED
155-
: client instanceof AbfsBlobClient
156-
? ERR_NO_LEASE_ID_SPECIFIED_BLOB
157-
: ERR_NO_LEASE_ID_SPECIFIED, () -> {
158-
try (FSDataOutputStream out2 = fs.create(testFilePath)) {
159-
}
160-
return "Expected second create on infinite lease dir to fail";
161-
});
156+
LambdaTestUtils.intercept(IOException.class,
157+
isHNSEnabled ? PARALLEL_ACCESS
158+
: client instanceof AbfsBlobClient
159+
? ERR_NO_LEASE_ID_SPECIFIED_BLOB
160+
: ERR_NO_LEASE_ID_SPECIFIED, () -> {
161+
try (FSDataOutputStream out2 = fs.create(testFilePath)) {
162+
}
163+
return "Expected second create on infinite lease dir to fail";
164+
});
162165
}
163166
Assert.assertTrue("Store leases were not freed", fs.getAbfsStore().areLeasesFreed());
164167
}

0 commit comments

Comments
 (0)