@@ -71,6 +71,8 @@ public class ITestAzureBlobFileSystemLease extends AbstractAbfsIntegrationTest {
71
71
private static final String TEST_FILE = "testfile" ;
72
72
private final boolean isHNSEnabled ;
73
73
private static final int TEST_BYTES = 20 ;
74
+ private static final String PARALLEL_ACCESS = "Parallel access to the create path "
75
+ + "detected" ;
74
76
75
77
public ITestAzureBlobFileSystemLease () throws Exception {
76
78
super ();
@@ -151,14 +153,15 @@ public void testTwoCreate() throws Exception {
151
153
fs .mkdirs (testFilePath .getParent ());
152
154
153
155
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
+ });
162
165
}
163
166
Assert .assertTrue ("Store leases were not freed" , fs .getAbfsStore ().areLeasesFreed ());
164
167
}
0 commit comments