Skip to content

[Repo Assist] test: expand threading and heapq test coverage#274

Draft
github-actions[bot] wants to merge 1 commit intomainfrom
repo-assist/test-improvements-2026-04-24-0a9e910a0b4a1106
Draft

[Repo Assist] test: expand threading and heapq test coverage#274
github-actions[bot] wants to merge 1 commit intomainfrom
repo-assist/test-improvements-2026-04-24-0a9e910a0b4a1106

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 This is an automated pull request from Repo Assist, an AI assistant for this repository.

Summary

Improves test coverage for two stdlib modules that had significant gaps.

TestThreading.fs — 3 tests → 16 tests (+13)

The existing file only tested get_ident, active_count, and local. None of the three concrete classes (Lock, RLock, Event) or the Thread class had any test coverage. New tests cover:

Area Tests added
Lock acquire/release lifecycle; locked() state tracking; non-blocking acquire returns false when already held
RLock acquire/release; reentrancy (same thread acquires twice)
Event initial state is false; set/clear toggle is_set; wait returns true when already set; wait(timeout=0.0) returns false when not set
Thread target function runs and result is visible after join; is_alive reflects lifecycle (falsetruefalse); name property; daemon default
Module fns main_thread, current_thread, enumerate

TestHeapq.fs — 5 tests → 7 tests (+2)

heapreplace (pop smallest, push new item atomically) had no tests. New tests verify:

  • return value is the old root
  • heap invariant is maintained after the replace

Files changed

  • test/TestHeapq.fs — 2 new tests for heapreplace
  • test/TestThreading.fs — 13 new tests covering Lock, RLock, Event, Thread, and threading module functions

No bindings were changed; this is a test-only PR.

Note: CHANGELOG.md is intentionally not updated per repository policy.

CI will validate the build and Python tests.

Note

🔒 Integrity filter blocked 10 items

The following items were blocked because they don't meet the GitHub integrity level.

To allow these resources, lower min-integrity in your GitHub frontmatter:

tools:
  github:
    min-integrity: approved  # merged | approved | unapproved | none

Generated by Repo Assist · ● 1.8M ·

- TestThreading.fs: add 13 new tests covering Lock (acquire/release/locked,
  non-blocking acquire), RLock (acquire/release, reentrancy), Event
  (set/clear/is_set/wait with and without timeout), Thread (start/join/
  is_alive lifecycle, name property), and threading module functions
  (main_thread, current_thread, enumerate).
- TestHeapq.fs: add 2 new tests for the previously untested heapreplace
  function, covering both the return value and heap invariant maintenance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants