eugenegujing opened a new pull request, #6444: URL: https://github.com/apache/texera/pull/6444
### What changes were proposed in this PR? Adds pytest coverage for `amber/src/main/python/core/models/internal_queue.py`, the Python worker's central `InternalQueue`, which previously had no dedicated spec. The 16 tests (17 with parametrization) cover: - **Element routing** — control channels dequeue before data channels; non-`InternalQueueElement` items go to the `SYSTEM` sub-queue and dequeue first; `DataElement` / `DCMElement` / `ECMElement` are all accepted; an unrecognized `InternalQueueElement` subclass raises `ValueError` on `put` without enqueuing anything. - **Per-category helpers** — `is_control_empty` / `is_data_empty`, `size_control` / `size_data`, `size` / `__len__`, and FIFO order within a channel. - **Pass-throughs** — per-channel `disable` / `enable` (as used by `PauseManager` for single-channel pauses) and `in_mem_size` (data channels only, asserted via deltas rather than hard-coded byte constants). - **Reason-tracked data-side disabling** (the main gap) — before this PR only `DISABLE_BY_PAUSE` was ever exercised anywhere in the test tree; `DISABLE_BY_BACKPRESSURE` and the multi-reason tracking were untested. The new tests confirm that with both reasons set, data stays disabled until every reason is cleared (`enable_data` returns `False` until the last one), parametrized over both clearing orders, plus repeated-reason idempotency, enabling by a reason that was never set, and enqueueing into a channel that is disabled during a pause (elements accumulate in `size_data` but stay un-gettable until re-enabled). This is a test-only change; no production code is modified. ### Any related issues, documentation, discussions? Closes #6440. ### How was this PR tested? ``` cd amber pytest src/test/python/core/models/test_internal_queue.py -v # 17 passed pytest src/test/python/core/models -q # 172 passed, no regressions ruff check src/test/python/core/models/test_internal_queue.py ruff format --check src/test/python/core/models/test_internal_queue.py ``` ### Was this PR authored or co-authored using generative AI tooling? Co-authored by: Claude Code (Fable 5) -- 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]
