You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace Thread.sleep with event-driven waits in pause/reconfiguration tests #4517
Two e2e specs use hardcoded Thread.sleep to wait for state transitions instead of reacting to ExecutionStateUpdate events:
PauseSpec.shouldPause (amber/src/test/scala/.../e2e/PauseSpec.scala:111-117): three sleeps (4000 + 400 + 4000 ms) per call. With 2 tests in the spec, that's ~16.8s of pure sleep.
ReconfigurationSpec.shouldReconfigure (ReconfigurationSpec.scala:151): one Thread.sleep(4000) after pauseWorkflow.
In both cases the sleep is "wait for the engine to reach PAUSED before the next action." AmberClient already exposes registerCallback[ExecutionStateUpdate], so a Promise that resolves on the matching state event is a drop-in replacement and exits as soon as the engine actually transitions.
Local measurement on PauseSpec: Run completed in 41s 869ms → 28s 791ms, ~13s saved.
The 400ms sleep after resumeWorkflow cannot currently be replaced by an event-driven wait — ResumeHandler does not emit ExecutionStateUpdate (tracked separately in #4514). It can be dropped in a follow-up once that issue is fixed.
The 1000ms sleep at ReconfigurationSpec.scala:132 (per terminal op, inside the COMPLETED callback) is left alone — its TODO comment marks it as a known workaround for "completion reported too early," which is a different bug.
Activity
perf(amber): replace Thread.sleep with event-driven waits in e2e specs (
perf(amber): replace Thread.sleep with event-driven waits in e2e specs (