aglinxinyuan opened a new issue, #7869: URL: https://github.com/apache/texera/issues/7869
### Task Summary `amber/src/main/scala/org/apache/texera/web/WorkflowLifecycleManager.scala` is the lowest-coverage free file left — 50.0% by Codecov's metric, with 3 missed and 11 partial of only 28 lines, and 21 of 40 branch arms uncovered. `WorkflowLifecycleManagerSpec` has 3 tests. What it manages is the deferred clean-up of a finished workflow: a deadline that gets refreshed on later terminal states, postponed while a user is connected, and cancelled when a user reconnects before it fires. None of that is currently pinned. Traps worth knowing: 1. **There is no injectable clock.** `cleanUpTimeout` is an `Int` in seconds and the scheduler is reached through the `AmberRuntime` singleton, so a spec pays real wall-clock time. Budget for it — a thorough suite here runs about 37s — and do not try to shorten it by mutating production. 2. **Fixture literals collide in a way that hides mutants.** With a short `cleanUpTimeout` and a user count of 1, a mutation to the timeout and a mutation to the count can both produce the same observable outcome. Raising the timeout separates them. 3. **Comparing a fired-at instant against a logged deadline needs tolerance.** The comparison crosses pekko's `nanoTime`-based scheduler wheel and the wall clock, so an exact-boundary assertion is flaky; a couple of hundred milliseconds of slack is appropriate. 4. **One appealing test would assert an accident as a requirement.** "Does not schedule a second clean-up once the first has completed" is not a designed behaviour — it falls out of `cleanUp` never resetting its own flag plus pekko's post-fire `Cancellable` semantics. Name it for what it is. 5. **Three lines cannot be fully covered**, so the file cannot exceed 25/28 without a production change: the Scala 2.13 lazy-val bitmap re-check inside `logger$lzycompute`, and two similar guards. 6. **Line 97 is not tracked at all.** `setCleanUpDeadline(newState.state)` sits inside a subscribe lambda that `SyntheticFilter` drops — the report lists exactly 28 lines and 97 is not among them. A test aimed there earns behaviour but no coverage. ### Task Type - [ ] Refactor / Cleanup - [ ] DevOps / Deployment / CI - [x] Testing / QA - [ ] Documentation - [ ] Performance - [ ] Other -- 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]
