HADOOP-16650. ITestS3AClosedFS failing.

Contributed by Steve Loughran.

Change-Id: Ia9bb84bd6455e210a54cfe9eb944feeda8b58da9
This commit is contained in:
Steve Loughran 2019-10-10 17:32:12 +01:00
parent 104ccca916
commit effe6087a5
No known key found for this signature in database
GPG Key ID: D22CF846DBB162A0
1 changed files with 6 additions and 2 deletions

View File

@ -1396,13 +1396,17 @@ public final class S3ATestUtils {
}
/**
* Get a set containing the names of all active threads.
* Get a set containing the names of all active threads,
* stripping out all test runner threads.
* @return the current set of threads.
*/
public static Set<String> getCurrentThreadNames() {
return Thread.getAllStackTraces().keySet()
TreeSet<String> threads = Thread.getAllStackTraces().keySet()
.stream()
.map(Thread::getName)
.filter(n -> n.startsWith("JUnit"))
.filter(n -> n.startsWith("surefire"))
.collect(Collectors.toCollection(TreeSet::new));
return threads;
}
}