Browse Source

[Test] More accurate pattern matching for testWatchdogLogging (#128648) (#128663)

There might be other thread temporarily not making progress and reported
by the watchdog. This PR tightens up the pattern matching for the
expected thread name.

Resolves: #128646
Yang Wang 4 months ago
parent
commit
19e9f1020d

+ 1 - 1
test/framework/src/main/java/org/elasticsearch/transport/AbstractSimpleTransportTestCase.java

@@ -3360,7 +3360,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
         MockLog.assertThatLogger(
             deterministicTaskQueue::runAllRunnableTasks,
             ThreadWatchdog.class,
-            new MockLog.UnseenEventExpectation("no logging", ThreadWatchdog.class.getCanonicalName(), Level.WARN, "*")
+            new MockLog.UnseenEventExpectation("no logging", ThreadWatchdog.class.getCanonicalName(), Level.WARN, "*" + threadName + "*")
         );
         deterministicTaskQueue.advanceTime();
         MockLog.assertThatLogger(