Skip to content

add unit test coverage for Python InternalQueue #6440

Closed

Description

@eugenegujing

Task Summary

amber/src/main/python/core/models/internal_queue.py implements the Python worker's central InternalQueue. It routes incoming elements into per-channel sub-queues (control channels registered at higher priority than data channels, non-queue-elements going to the SYSTEM sub-queue) and implements reason-tracked data-side disabling: data queues are disabled for a reason (DISABLE_BY_PAUSE or DISABLE_BY_BACKPRESSURE) and only re-enabled once every disable reason has been cleared.

The queue has no dedicated test. Several test files construct an InternalQueue as scaffolding, and test_main_loop.py calls disable_data/enable_data only to drive main-loop pause/resume — but no test asserts the queue's own semantics: only DISABLE_BY_PAUSE is ever used, and DISABLE_BY_BACKPRESSURE and the multi-reason disable tracking are never exercised anywhere in the test tree.

Note that the underlying LinkedBlockingMultiQueue already has a dedicated test (amber/src/test/python/core/util/customized_queue/test_linked_blocking_multi_queue.py, added in #4782), and test_pause_manager.py only asserts PauseManager's own is_paused() flag. This issue targets the layer neither of them covers: InternalQueue's per-channel routing (control vs. data priority, SYSTEM sub-queue, ValueError on unrecognized elements) and its reason-tracked disable_data/enable_data semantics.

Task Type

  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other

Activity

  1. eugenegujing commented on Jul 15, 2026

    @eugenegujing
    ContributorAuthor

    /take

  2. added a commit that references this issue on Jul 17, 2026
    c882625
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions