Skip to content

test: add scheduler-loop integration test for non-cancel message queuing during plan execution #1611

@bug-ops

Description

@bug-ops

Context

Issue #1603 added tokio::select! in run_scheduler_loop() to poll channel.recv() concurrently with scheduler.wait_event(). Non-cancel messages received during plan execution are queued via enqueue_or_merge().

Missing test (COV-03)

There is no integration test that verifies this queuing behavior end-to-end: that a non-cancel message delivered to the channel during scheduler loop execution appears in message_queue after the plan completes.

The enqueue_or_merge() unit tests in message_queue.rs cover the queue logic in isolation, but not the scheduler loop path.

Acceptance criteria

  • A #[tokio::test] in agent/tests.rs that:
    1. Builds an agent with a MockChannel pre-loaded with a non-cancel message (e.g. "hello")
    2. Runs the scheduler with a graph that completes on the first tick
    3. Asserts that agent.message_queue contains the queued message after plan completion

Labels

enhancement, testing

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions