Skip to content

Fix test_cursor_execute_timeout + add Python 3.10 to PR matrix#2823

Closed
sfc-gh-fpawlowski wants to merge 1 commit intomainfrom
fix-test-cursor-execute-timeout-windows-with-matrix
Closed

Fix test_cursor_execute_timeout + add Python 3.10 to PR matrix#2823
sfc-gh-fpawlowski wants to merge 1 commit intomainfrom
fix-test-cursor-execute-timeout-windows-with-matrix

Conversation

@sfc-gh-fpawlowski
Copy link
Contributor

Summary

  • Test fix: test_cursor_execute_timeout was consistently failing on Windows Python 3.9/3.10 in CI after --dist worksteal was enabled. On Windows, time.sleep() on Python <3.11 uses WaitForSingleObjectEx with alertable I/O (bAlertable=TRUE), which can return early when an APC (Asynchronous Procedure Call) is queued — e.g. from --dist worksteal's inter-worker socket communication. This caused the 1-second timebomb to be cancelled in the finally block before it had a chance to fire. Replaced time.sleep(10) with threading.Event.wait() so mock_cmd_query blocks until __cancel_query is actually invoked, making timing irrelevant.

  • Matrix update: Added Python 3.10 to the PR matrix (ci/generate_full_matrix.py) so Windows 3.10 (the primary affected platform) is covered in every PR run. Regenerated generated_pr_matrix.json (6 → 9 entries).

Test plan

  • Verify test_cursor_execute_timeout passes on Windows Python 3.9 and 3.10 in CI
  • Confirm PR matrix now includes Python 3.10 for all three OSes (ubuntu, macos, windows)

🤖 Generated with Claude Code

@sfc-gh-fpawlowski sfc-gh-fpawlowski requested a review from a team as a code owner March 24, 2026 22:54
…trix

Root cause: --dist worksteal (added in #2819) creates continuous TCP socket
I/O between xdist workers. On Windows Python <3.11 this triggers a kernel
bug where WaitForSingleObjectEx returns WAIT_FAILED for unrelated handles,
breaking all threading primitives and time.sleep(), causing
test_cursor_execute_timeout and other timing-sensitive tests to fail on
Windows 3.9 and 3.10.

Changes:
- tox.ini: replace --dist worksteal with --dist load; load distributes test
  items upfront without ongoing socket traffic, avoiding the OS bug entirely
- ci/generate_full_matrix.py: enable PY310 on PRs (test_on_pr=True) and add
  PR_EXTRA_COMBINATIONS to include Windows 3.9/3.10 on all three CSPs so
  every previously-failing combination is verified on each PR
- Regenerate generated_pr_matrix.json (13 entries, up from 6)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sfc-gh-fpawlowski sfc-gh-fpawlowski force-pushed the fix-test-cursor-execute-timeout-windows-with-matrix branch from 6c99321 to f68885d Compare March 25, 2026 11:32
@github-actions github-actions bot locked and limited conversation to collaborators Mar 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant