Skip to content

Optimize TrivialControlSpec test runtime #4505

Closed

Description

@Yicong-Huang

Task Summary

TrivialControlSpec (amber/src/test/scala/org/apache/texera/amber/engine/architecture/control/TrivialControlSpec.scala) takes ~70s in CI for only 8 simple tests, making it the single slowest spec in the Scala test step (~22% of total backend test time).

The bottleneck is in testControl[T]:

probe.receiveWhile(5.minutes, 10.seconds) {
  case GetActorRef(...) => ...
  case NetworkMessage(...) => ... flag += 1
  case other => //skip
}

case other matches every message, so receiveWhile never exits via partial-function mismatch. Once all expected returns are received, the test sits idle for the full 10s receiveWhile idle timeout before the loop returns. With 8 tests, that's ~80s of pure waiting.

Replacing receiveWhile with a manual loop that exits as soon as flag == expectedValues.length brings the spec from ~71s to ~1s in local runs.

Priority

P2 – Medium

Task Type

  • Refactor / Cleanup
  • Testing / QA

Activity

  1. self-assigned this
    on Apr 26, 2026
  2. added a commit that references this issue on Apr 26, 2026
    76480d9
  3. added a commit that references this issue on Jun 22, 2026
    84d216d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions