2020import java .io .IOException ;
2121import java .util .concurrent .Callable ;
2222import java .util .concurrent .RejectedExecutionException ;
23+ import java .util .concurrent .TimeUnit ;
2324
2425import org .junit .jupiter .api .Test ;
2526
6566 * Test lease operations.
6667 */
6768public class ITestAzureBlobFileSystemLease extends AbstractAbfsIntegrationTest {
68- private static final int TEST_EXECUTION_TIMEOUT = 30 ;
69- private static final int LONG_TEST_EXECUTION_TIMEOUT = 90 ;
69+ private static final int TEST_EXECUTION_TIMEOUT = 30 * 1000 ;
70+ private static final int LONG_TEST_EXECUTION_TIMEOUT = 90 * 1000 ;
7071 private static final String TEST_FILE = "testfile" ;
7172 private final boolean isHNSEnabled ;
7273 private static final int TEST_BYTES = 20 ;
@@ -88,7 +89,7 @@ private AzureBlobFileSystem getCustomFileSystem(Path infiniteLeaseDirs, int numL
8889 }
8990
9091 @ Test
91- @ Timeout (TEST_EXECUTION_TIMEOUT )
92+ @ Timeout (value = TEST_EXECUTION_TIMEOUT , unit = TimeUnit . MILLISECONDS )
9293 public void testNoInfiniteLease () throws IOException {
9394 final Path testFilePath = new Path (path (methodName .getMethodName ()), TEST_FILE );
9495 final AzureBlobFileSystem fs = getFileSystem ();
@@ -101,7 +102,7 @@ public void testNoInfiniteLease() throws IOException {
101102 }
102103
103104 @ Test
104- @ Timeout (TEST_EXECUTION_TIMEOUT )
105+ @ Timeout (value = TEST_EXECUTION_TIMEOUT , unit = TimeUnit . MILLISECONDS )
105106 public void testNoLeaseThreads () throws Exception {
106107 final Path testFilePath = new Path (path (methodName .getMethodName ()), TEST_FILE );
107108 final AzureBlobFileSystem fs = getCustomFileSystem (testFilePath .getParent (), 0 );
@@ -114,7 +115,7 @@ public void testNoLeaseThreads() throws Exception {
114115 }
115116
116117 @ Test
117- @ Timeout (TEST_EXECUTION_TIMEOUT )
118+ @ Timeout (value = TEST_EXECUTION_TIMEOUT , unit = TimeUnit . MILLISECONDS )
118119 public void testOneWriter () throws Exception {
119120 final Path testFilePath = new Path (path (methodName .getMethodName ()), TEST_FILE );
120121 final AzureBlobFileSystem fs = getCustomFileSystem (testFilePath .getParent (), 1 );
@@ -130,7 +131,7 @@ public void testOneWriter() throws Exception {
130131 }
131132
132133 @ Test
133- @ Timeout (TEST_EXECUTION_TIMEOUT )
134+ @ Timeout (value = TEST_EXECUTION_TIMEOUT , unit = TimeUnit . MILLISECONDS )
134135 public void testSubDir () throws Exception {
135136 final Path testFilePath = new Path (new Path (path (methodName .getMethodName ()), "subdir" ),
136137 TEST_FILE );
@@ -148,7 +149,7 @@ public void testSubDir() throws Exception {
148149 }
149150
150151 @ Test
151- @ Timeout (TEST_EXECUTION_TIMEOUT )
152+ @ Timeout (value = TEST_EXECUTION_TIMEOUT , unit = TimeUnit . MILLISECONDS )
152153 public void testTwoCreate () throws Exception {
153154 final Path testFilePath = new Path (path (methodName .getMethodName ()), TEST_FILE );
154155 final AzureBlobFileSystem fs = getCustomFileSystem (testFilePath .getParent (), 1 );
@@ -207,7 +208,7 @@ private void twoWriters(AzureBlobFileSystem fs, Path testFilePath, boolean expec
207208 }
208209
209210 @ Test
210- @ Timeout (TEST_EXECUTION_TIMEOUT )
211+ @ Timeout (value = TEST_EXECUTION_TIMEOUT , unit = TimeUnit . MILLISECONDS )
211212 public void testTwoWritersCreateAppendNoInfiniteLease () throws Exception {
212213 final Path testFilePath = new Path (path (methodName .getMethodName ()), TEST_FILE );
213214 final AzureBlobFileSystem fs = getFileSystem ();
@@ -218,7 +219,7 @@ public void testTwoWritersCreateAppendNoInfiniteLease() throws Exception {
218219 }
219220
220221 @ Test
221- @ Timeout (LONG_TEST_EXECUTION_TIMEOUT )
222+ @ Timeout (value = LONG_TEST_EXECUTION_TIMEOUT , unit = TimeUnit . MILLISECONDS )
222223 public void testTwoWritersCreateAppendWithInfiniteLeaseEnabled () throws Exception {
223224 final Path testFilePath = new Path (path (methodName .getMethodName ()), TEST_FILE );
224225 final AzureBlobFileSystem fs = getCustomFileSystem (testFilePath .getParent (), 1 );
@@ -229,7 +230,7 @@ public void testTwoWritersCreateAppendWithInfiniteLeaseEnabled() throws Exceptio
229230 }
230231
231232 @ Test
232- @ Timeout (TEST_EXECUTION_TIMEOUT )
233+ @ Timeout (value = TEST_EXECUTION_TIMEOUT , unit = TimeUnit . MILLISECONDS )
233234 public void testLeaseFreedOnClose () throws Exception {
234235 final Path testFilePath = new Path (path (methodName .getMethodName ()), TEST_FILE );
235236 final AzureBlobFileSystem fs = getCustomFileSystem (testFilePath .getParent (), 1 );
@@ -247,7 +248,7 @@ public void testLeaseFreedOnClose() throws Exception {
247248 }
248249
249250 @ Test
250- @ Timeout (TEST_EXECUTION_TIMEOUT )
251+ @ Timeout (value = TEST_EXECUTION_TIMEOUT , unit = TimeUnit . MILLISECONDS )
251252 public void testWriteAfterBreakLease () throws Exception {
252253 final Path testFilePath = new Path (path (methodName .getMethodName ()), TEST_FILE );
253254 final AzureBlobFileSystem fs = getCustomFileSystem (testFilePath .getParent (), 1 );
@@ -292,7 +293,7 @@ public void testWriteAfterBreakLease() throws Exception {
292293 }
293294
294295 @ Test
295- @ Timeout (LONG_TEST_EXECUTION_TIMEOUT )
296+ @ Timeout (value = LONG_TEST_EXECUTION_TIMEOUT , unit = TimeUnit . MILLISECONDS )
296297 public void testLeaseFreedAfterBreak () throws Exception {
297298 final Path testFilePath = new Path (path (methodName .getMethodName ()), TEST_FILE );
298299 final AzureBlobFileSystem fs = getCustomFileSystem (testFilePath .getParent (), 1 );
@@ -316,7 +317,7 @@ public void testLeaseFreedAfterBreak() throws Exception {
316317 }
317318
318319 @ Test
319- @ Timeout (TEST_EXECUTION_TIMEOUT )
320+ @ Timeout (value = TEST_EXECUTION_TIMEOUT , unit = TimeUnit . MILLISECONDS )
320321 public void testInfiniteLease () throws Exception {
321322 final Path testFilePath = new Path (path (methodName .getMethodName ()), TEST_FILE );
322323 final AzureBlobFileSystem fs = getCustomFileSystem (testFilePath .getParent (), 1 );
@@ -338,7 +339,7 @@ public void testInfiniteLease() throws Exception {
338339 }
339340
340341 @ Test
341- @ Timeout (TEST_EXECUTION_TIMEOUT )
342+ @ Timeout (value = TEST_EXECUTION_TIMEOUT , unit = TimeUnit . MILLISECONDS )
342343 public void testFileSystemClose () throws Exception {
343344 final Path testFilePath = new Path (path (methodName .getMethodName ()), TEST_FILE );
344345 final AzureBlobFileSystem fs = getCustomFileSystem (testFilePath .getParent (), 1 );
@@ -377,7 +378,7 @@ public void testFileSystemClose() throws Exception {
377378 }
378379
379380 @ Test
380- @ Timeout (TEST_EXECUTION_TIMEOUT )
381+ @ Timeout (value = TEST_EXECUTION_TIMEOUT , unit = TimeUnit . MILLISECONDS )
381382 public void testAcquireRetry () throws Exception {
382383 final Path testFilePath = new Path (path (methodName .getMethodName ()), TEST_FILE );
383384 final AzureBlobFileSystem fs = getCustomFileSystem (testFilePath .getParent (), 1 );
0 commit comments