Yicong-Huang opened a new issue, #4517:
URL: https://github.com/apache/texera/issues/4517

   ### Task Summary
   
   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.
   
   ### Priority
   
   P2 – Medium
   
   ### Task Type
   
   - [x] Refactor / Cleanup
   - [x] Testing / QA


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to