Skip to content

Test priority updates and removed tasks in both queue backends - #564

Closed
zanmlakar wants to merge 1 commit into
mahmoud:masterfrom
zanmlakar:test-priority-queue-updates
Closed

zanmlakar wants to merge 1 commit into
mahmoud:masterfrom
zanmlakar:test-priority-queue-updates

Conversation

@zanmlakar

Copy link
Copy Markdown

The change

Add public API regression coverage for HeapPriorityQueue and SortedPriorityQueue. The existing tests exercise numeric ordering, but do not pin reprioritization, stable ties between nonorderable tasks, or culling after removal. The new cases cover these behaviors plus removed-only queue defaults and errors.

No production behavior changes. This is a test gap found in https://github.com/mahmoud/boltons/blob/4e5faa3d7e4008d89e0d8bf1ea87b6d9a061a16d/tests/test_queueutils.py, rather than a reported bug.

Validation: uvx --with tox-uv tox -e py314 passed all 690 tests and doctests (5 existing deprecation warnings). Focused queue tests pass all 14 cases. Two in-memory mutation checks showed the new tests fail when stable tie counters or removed-entry marking are disabled. git diff --check passed.

The backstory

I’m working on making useful open-source contributions. This contribution came from reviewing Boltons’ queue tests with Codex and finding missing coverage for priority updates and removed entries.

AI assistance

  • Harness/tooling: Codex desktop agent with local git, GitHub CLI read-only research, uv and pytest.
  • Model(s): Codex coordinator (exact serving model identifier unavailable); gpt-6.1-sol implementation and independent review agents.
  • Original prompt(s): The user request is included below. The implementation agent was assigned: "Own ONE valuable Python OSS contribution from research through local implementation." After inspecting the existing tests, the coordinator specified: "Cover public behavior, not internal sentinel/heap shapes. Both backends, reprioritization up/down, FIFO with nonorderable tasks, removed-only queue/default/peek nonmutation if within coherent suite. Keep subset proportionate."
Original user request

Act as the coordinator for multiple subagents making useful contributions to open-source projects. Dispatch subagents to find and implement distinct, well-scoped tasks: bug fixes, requested improvements, missing tests, or substantive documentation corrections.

The goal is genuinely valuable, maintainable contributions—not maximizing the number of pull requests.

Task selection and coordination

  • Find actionable tasks supported by issue discussions, reproducible bugs, or clear gaps in the project. Prefer work maintainers have explicitly welcomed.
  • Check existing issues, pull requests, and recent discussions to avoid duplicating work or implementing something maintainers have rejected.
  • Give each subagent ownership of a separate task. Maintain a shared tracker with the repository, issue, scope, assigned agent, and progress.
  • Use isolated working directories and branches so agents cannot overwrite one another’s work.

Respect each repository

  • Before changing anything, read the relevant README, CONTRIBUTING, AGENTS.md, contribution policies, issue discussions, and pull-request templates.
  • Follow the repository’s existing architecture, coding style, naming, formatting, code-comment conventions, commit-message structure, and review process.
  • Check its policy on AI-assisted contributions. Respect any restrictions and make required disclosures honestly.
  • Where maintainers require approval or discussion before implementation, flag that requirement rather than bypassing it. Do not proceed with work that conflicts with their stated preferences.

Implementation

  • Understand the relevant code and intended behavior before editing.
  • Keep each contribution focused on one coherent problem. Avoid unrelated refactoring, formatting churn, unnecessary dependencies, and speculative features.
  • Add or update appropriate tests. For bug fixes, establish a reproduction and, where feasible, demonstrate that the regression test fails before the fix and passes afterward.
  • Match the project’s approach rather than introducing a new pattern merely because an agent prefers it.
  • Do not split one logical change into multiple pull requests just to inflate contribution counts.

Verification and review

  • Run the relevant tests, linting, formatting, type checks, and build checks required by the project.
  • Report exactly what ran, what passed or failed, and what could not be verified. Never claim unperformed checks passed or weaken tests to hide failures.
  • Review each subagent’s changes before accepting them as complete. Use an independent review agent for nontrivial changes.
  • Flag ambiguity, blockers, and decisions requiring my input instead of guessing or broadening the scope.

For each completed task, provide the repository and issue link, a concise explanation of the problem and solution, the branch and changed files, verification results, remaining concerns, and a pull-request draft following that repository’s template.

Research and implement autonomously, but keep public actions behind my approval: do not post comments, open issues, push to remote repositories, or submit pull requests until I approve.

@Saadia751 Saadia751 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I exercised both queue backends against a small independent model: 180 deterministic add/update/remove operations per backend, with negative priorities and stable ties. Queue length and peek() match the model after every operation, and draining matches priority/insertion order. Empty defaults and errors also agree.

This adds an interleaved-operation check beyond the new targeted regressions. Checked 7ea6c0bade3e with standalone Python 3.12.14 checks (726 passing assertions). I haven't run the full upstream suite.

@mahmoud

mahmoud commented Oct 25, 2026

Copy link
Copy Markdown
Owner

These tests pass on current master, so they pin behavior that already works; not adding test weight without a bug. Closing.

@mahmoud mahmoud closed this Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants