Skip to content

Add boundary case tests for scheduler with homogeneous priority queues #191

@coderabbitai

Description

@coderabbitai

Background

This issue is a follow-up to PR #189 which adds parameterized tests for scheduler priority behavior when fairness is disabled.

Problem

The current test cases in tests/connection_actor.rs only test scenarios with mixed priority frames. We need boundary case testing to ensure the scheduler handles edge cases correctly when queues contain only high-priority or only low-priority frames.

Proposed Solution

Add boundary case test scenarios to verify the scheduler handles empty queues correctly when:

  1. Only high-priority frames are present
  2. Only low-priority frames are present

These tests should verify that the scheduler processes frames correctly without attempting to access empty queues of the opposite priority.

Acceptance Criteria

  • Add test case with only high-priority frames (e.g., [High, High, High])
  • Add test case with only low-priority frames (e.g., [Low, Low, Low])
  • Verify frames are processed in the correct order (should maintain arrival order within same priority)
  • Ensure no runtime errors occur when one priority queue is empty
  • Tests should pass with the current scheduler implementation
  • Follow existing code patterns and use the Priority enum

Context

Implementation Notes

These boundary cases could be added as additional #[case] attributes to the existing parameterized test, or as separate test functions if the logic differs significantly.

Consider edge cases like:

  • Empty queues of opposite priority
  • Proper iterator handling when one priority type is absent
  • Maintaining arrival order within the same priority level

Backlinks:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions