Skip to content

test(amber): warm up ReconfigurationIntegrationSpec before timed assertions#4947

Merged
Yicong-Huang merged 2 commits intoapache:mainfrom
Yicong-Huang:test/warmup-reconfig-spec
May 6, 2026
Merged

test(amber): warm up ReconfigurationIntegrationSpec before timed assertions#4947
Yicong-Huang merged 2 commits intoapache:mainfrom
Yicong-Huang:test/warmup-reconfig-spec

Conversation

@Yicong-Huang
Copy link
Copy Markdown
Contributor

@Yicong-Huang Yicong-Huang commented May 5, 2026

What changes were proposed in this PR?

Add a warmupOnce() step to ReconfigurationIntegrationSpec.beforeAll that runs a trivial pure-Scala TextInputSourceOpDesc workflow before the timed test cases. This pays the JVM JIT + class-loading + pekko first-touch bill before the first Await.result(client.controllerInterface.startWorkflow(...), 5.seconds) runs in TestUtils.shouldReconfigure, which is where the suite has been intermittently timing out.

The warmup is pure Scala (no Python), hard-capped at 10 seconds, and defensively wrapped: any exception is logged and swallowed, client.shutdown() and cleanupWorkflowExecutionData() always run, so warmup itself can never hang the suite. The existing Retries mixin still backs up individual test cases.

Any related issues, documentation, discussions?

Closes #4946.

How was this PR tested?

sbt WorkflowExecutionService/Test/compile clean; sbt WorkflowExecutionService/scalafmtCheckAll clean. CI amber-integration job is the real test surface.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Opus 4.7 (Claude Code)

…rtions

The first test in this suite intermittently times out on the 5-second
`Await.result(client.controllerInterface.startWorkflow(...))` while the
next test in the same JVM passes with the same budget — the cost is
JVM-side first-touch (JIT, pekko dispatcher, RegionExecutionCoordinator
class loading), not anything the test itself controls.

Run a trivial pure-Scala TextInput → terminal workflow once in
`beforeAll` so the JIT/class-loading bill is paid before any timed
assertion. No Python is involved, so the warmup itself doesn't recreate
the Python-worker cold-start cost it's trying to absorb on the JVM
side.

Hard cap the warmup at 10 seconds and wrap it in try/catch/finally:
- Both Awaits use the same 10s ceiling, so warmup can never hang the
  suite.
- Any exception is logged and swallowed; the existing `Retries` mixin
  still backs up individual test cases.
- `client.shutdown()` and `cleanupWorkflowExecutionData()` always run.

Refs apache#4946.
@Yicong-Huang Yicong-Huang force-pushed the test/warmup-reconfig-spec branch from fd1c17b to 8c0d69a Compare May 5, 2026 15:09
@Yicong-Huang Yicong-Huang requested a review from aglinxinyuan May 5, 2026 18:23
@Yicong-Huang Yicong-Huang enabled auto-merge (squash) May 5, 2026 23:54
@Yicong-Huang Yicong-Huang merged commit 635f0cf into apache:main May 6, 2026
13 checks passed
@Yicong-Huang Yicong-Huang deleted the test/warmup-reconfig-spec branch May 6, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test: first startWorkflow in ReconfigurationIntegrationSpec times out at 5s

2 participants