Skip to content

fix(test): unflake test_profile_linear_dag on Windows#18

Merged
pratyush618 merged 5 commits into
masterfrom
fix/profile-test-windows-clock
May 9, 2026
Merged

fix(test): unflake test_profile_linear_dag on Windows#18
pratyush618 merged 5 commits into
masterfrom
fix/profile-test-windows-clock

Conversation

@pratyush618
Copy link
Copy Markdown
Collaborator

Summary

test_profile_linear_dag flaked on windows-latest runners (e.g. PR #17 first attempt). Each node in the linear DAG sleeps for _delayed("a", seconds=0.01) — 10 ms. Windows' time.monotonic() has roughly 16 ms granularity, so a 10 ms sleep can register as duration=0.0, which excludes the node from the profile's critical path. The test then asserts len(report.critical_path) == 3 and fails because only 2 nodes were on it.

Bump the default sleep in _delayed from 10 ms → 50 ms so every node's measured duration always crosses at least one Windows timer tick.

Test plan

  • uv run pytest tests/python/execution/test_profiling.py -q — all 9 pass locally
  • CI on this PR — Windows runners no longer flake on this test
  • No knock-on slowness: _delayed is only called by test_profile_linear_dag, so the increase is bounded to ~120 ms total on this single test

test_profile_linear_dag flaked on windows-latest because the per-node
10ms sleep is below the ~16ms granularity of Windows' time.monotonic.
Nodes occasionally measured duration=0.0 and got excluded from the
critical path. Bump the default to 50ms so every sleep crosses at
least one timer tick.
uv.lock still pinned the editable dagron at 0.1.0 after #17 bumped
pyproject.toml to 0.1.1. Refresh the lockfile so the working tree
matches the published version.
GitHub deprecated Node 20 actions; v4 of pnpm/action-setup runs on
Node 20. Bump to v6 which uses Node 24 natively. The remaining
actions/cache@v4 warning is transitive from actions/setup-node and
auto-resolves once @v6 picks up its v6.2+ patch (which already uses
@actions/cache v5.0.1). The windows-latest notice is just informing
about the May 12 default flip to windows-2025-vs2026.
Drop the v2.9.1 / v3.0.1 patch pins on Swatinem/rust-cache and
pre-commit/action — major-only references auto-pick up bug fixes
without manual bumps.
That action only publishes full-semver tags (v3.0.0, v3.0.1); v3
isn't a ref so the previous bump broke the lint job with
"Unable to resolve action pre-commit/action@v3". Swatinem/rust-cache
and pnpm/action-setup do ship rolling major tags and stay at @v2 / @v6.
@pratyush618 pratyush618 merged commit 2267990 into master May 9, 2026
8 checks passed
@pratyush618 pratyush618 deleted the fix/profile-test-windows-clock branch May 9, 2026 22:44
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.

1 participant