Skip to content

Commit 46e4fa2

Browse files
morningmanclaude
andcommitted
[fix](test) poll until task timeout converges in RoutineLoadTestUtils.checkTaskTimeout
checkTaskTimeout asserted on the first visible task, but a just-scheduled task (txnId == -1) can still carry the timeout from a previous schedule round before the adaptive timeout converges, causing a flaky expected:3600/actual:100 race. Skip transient txnId == -1 tasks and poll until a stable task carries the expected timeout, failing with a clear message on timeout. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
1 parent 2a2e17a commit 46e4fa2

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

‎regression-test/framework/src/main/groovy/org/apache/doris/regression/util/RoutineLoadTestUtils.groovy‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,21 @@ class RoutineLoadTestUtils {
9191
while (true) {
9292
def res = sqlRunner.call("SHOW ROUTINE LOAD TASK WHERE JobName = '${jobName}'")
9393
if (res.size() > 0) {
94+
def txnId = res[0][1].toString()
95+
def timeout = res[0][6].toString()
9496
logger.info("res: ${res[0].toString()}")
95-
logger.info("timeout: ${res[0][6].toString()}")
96-
Assert.assertEquals(res[0][6].toString(), expectedTimeout)
97-
break;
97+
logger.info("txnId: ${txnId}, timeout: ${timeout}, expected: ${expectedTimeout}")
98+
// A task whose txn has not begun yet (txnId == -1) may still carry the timeout
99+
// computed in a previous schedule round; the adaptive timeout only converges
100+
// after a subsequent task is scheduled. Poll until a stable task carries the
101+
// expected timeout instead of asserting on a transient task.
102+
if (txnId != "-1" && timeout == expectedTimeout) {
103+
Assert.assertEquals(expectedTimeout, timeout)
104+
break;
105+
}
98106
}
99107
if (count > maxAttempts) {
100-
Assert.assertEquals(1, 2)
108+
Assert.fail("Timeout waiting for task timeout to converge to ${expectedTimeout} for job ${jobName}")
101109
break;
102110
} else {
103111
sleep(1000)

0 commit comments

Comments
 (0)