Check REST test nodes LeakTracker like we check Netty's LeakDetector (#108540)

We should make sure to find leaks reported by both of these, these days
our `LeakTracker` will likely be more sensitive that Netty's in some
cases since our objects refer to Netty objects and thus get collected
first.
This commit is contained in:
Armin Braun 2024-05-14 21:13:52 +02:00 committed by GitHub
parent b0f205fa74
commit c2f528e5a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1107,11 +1107,11 @@ public class ElasticsearchNode implements TestClusterConfiguration {
return;
}
boolean foundNettyLeaks = false;
boolean foundLeaks = false;
for (String logLine : errorsAndWarnings.keySet()) {
if (logLine.contains("ResourceLeakDetector]")) {
if (logLine.contains("ResourceLeakDetector") || logLine.contains("LeakTracker")) {
tailLogs = true;
foundNettyLeaks = true;
foundLeaks = true;
break;
}
}
@ -1140,8 +1140,8 @@ public class ElasticsearchNode implements TestClusterConfiguration {
});
}
}
if (foundNettyLeaks) {
throw new TestClustersException("Found Netty ByteBuf leaks in node logs.");
if (foundLeaks) {
throw new TestClustersException("Found resource leaks in node logs.");
}
}