Skip to content

Commit f306f88

Browse files
committed
fix test failures
1 parent 8322a19 commit f306f88

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public void testUnknownHost() throws Exception {
9393
public void testListPathWithValidListMaxResultsValues()
9494
throws IOException, ExecutionException, InterruptedException {
9595
final int fileCount = 10;
96-
final Path directory = path("testWithValidListMaxResultsValues");
96+
final Path directory = getUniquePath("testWithValidListMaxResultsValues");
9797
createDirectoryWithNFiles(directory, fileCount);
9898
final int[] testData = {fileCount + 100, fileCount + 1, fileCount,
9999
fileCount - 1, 1};
@@ -114,7 +114,7 @@ public void testListPathWithValidListMaxResultsValues()
114114
public void testListPathWithValueGreaterThanServerMaximum()
115115
throws IOException, ExecutionException, InterruptedException {
116116
setListMaxResults(LIST_MAX_RESULTS_SERVER + 100);
117-
final Path directory = path(
117+
final Path directory = getUniquePath(
118118
"testWithValueGreaterThanServerMaximum");
119119
createDirectoryWithNFiles(directory, LIST_MAX_RESULTS_SERVER + 200);
120120
Assertions.assertThat(listPath(directory.toString())).describedAs(

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ public void testOpenAppendRenameExists() throws IOException {
213213
assertAbfsStatistics(AbfsStatistic.CALL_RENAME, 1, metricMap);
214214

215215
//Testing if file exists at path.
216-
assertPathExists(fs,
217-
String.format("File with name %s should exist", destCreateFilePath),
218-
destCreateFilePath);
219-
assertPathDoesNotExist(fs,
220-
String.format("File with name %s should not exist", createFilePath),
221-
createFilePath);
216+
assertTrue(String.format("File with name %s should exist",
217+
destCreateFilePath),
218+
fs.exists(destCreateFilePath));
219+
assertFalse(String.format("File with name %s should not exist",
220+
createFilePath),
221+
fs.exists(createFilePath));
222222

223223
metricMap = fs.getInstrumentationMap();
224224
//Testing exists() calls.
@@ -246,10 +246,12 @@ public void testOpenAppendRenameExists() throws IOException {
246246
assertTrue(fs.rename(createFilePath, destCreateFilePath));
247247

248248
//check if first name is existing and 2nd is not existing.
249-
assertPathExists(fs, String.format("File with name %s should exist",
250-
destCreateFilePath), destCreateFilePath);
251-
assertPathDoesNotExist(fs, String.format(
252-
"File with name %s should not exist", createFilePath), createFilePath);
249+
assertTrue(String.format("File with name %s should exist",
250+
destCreateFilePath),
251+
fs.exists(destCreateFilePath));
252+
assertFalse(String.format("File with name %s should not exist",
253+
createFilePath),
254+
fs.exists(createFilePath));
253255

254256
}
255257

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void testBlobBackCompat() throws Exception {
5050
CloudBlobContainer container = blobClient.getContainerReference(this.getFileSystemName());
5151
container.createIfNotExists();
5252

53-
Path testPath = path("test");
53+
Path testPath = getUniquePath("test");
5454
CloudBlockBlob blockBlob = container
5555
.getBlockBlobReference(testPath + "/10/10/10");
5656
blockBlob.uploadText("");

0 commit comments

Comments
 (0)