Skip to content

Make interpreter cache invalidation test deterministic - #1848

Closed
zaniebot wants to merge 2 commits into
mainfrom
zb/future-20260912-interpreter-cache-ctime-test
Closed

zaniebot wants to merge 2 commits into
mainfrom
zb/future-20260912-interpreter-cache-ctime-test

Conversation

@zaniebot

@zaniebot zaniebot commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Consecutive writes to the mock Python executable can retain the same Unix ctime, making test_cache_invalidation fail before exercising cache invalidation. Give the well-formed cached entry a different timestamp so the stale-cache case is independent of filesystem clock resolution.

Consecutive executable writes can have the same Unix ctime. Give the existing well-formed interpreter cache entry a deliberately different timestamp, then assert that the real query path replaces its stale metadata and reuses the refreshed entry.
@astral-automations-bot astral-automations-bot Bot added internal A refactor or improvement that is not user-facing internal:ci-flake Related to internal CI flakes internal:testing Internal testing of behavior labels Sep 16, 2026
@codspeed

codspeed Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by ×9.1

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 11 improved benchmarks
✅ 43 untouched benchmarks
🆕 7 new benchmarks
⏩ 35 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ WallTime unzip_wheel_many_files 371 ms 12.4 ms ×30
⚡ WallTime install_wheel_many_files 385 ms 13.7 ms ×28
⚡ WallTime prepare_wheel_many_files 383.4 ms 15 ms ×26
⚡ WallTime unpack_sdist_many_files 317.2 ms 36.6 ms ×8.7
⚡ WallTime resolve_warm_jupyter_universal 87.6 ms 11.8 ms ×7.4
⚡ WallTime resolve_warm_jupyter 17.4 ms 2.5 ms ×7
⚡ WallTime discover_workspace_from_all_members_with_excludes 52.7 ms 8.4 ms ×6.3
⚡ WallTime discover_workspace_from_all_members 50.5 ms 8.1 ms ×6.2
⚡ WallTime run_python_version_synthetic_workspace 268.4 ms 43.8 ms ×6.1
⚡ WallTime resolve_warm_airflow 233.2 ms 41.9 ms ×5.6
⚡ WallTime hash_sha256 1,165.6 µs 412.2 µs ×2.8
🆕 Simulation cli_command N/A 12.9 ms N/A
🆕 Simulation pip_compile N/A 21.6 ms N/A
🆕 Simulation pip_install N/A 21.2 ms N/A
🆕 Simulation tool_install N/A 21.2 ms N/A
🆕 Simulation preview_bool N/A 59.4 µs N/A
🆕 Simulation preview_list N/A 72.8 µs N/A
🆕 Simulation trusted_hosts N/A 106.3 µs N/A

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing zb/future-20260912-interpreter-cache-ctime-test (9a13dd6) with main (b7c8c62)2

Open in CodSpeed

Footnotes

  1. 35 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (8ad4e46) during the generation of this report, so b7c8c62 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@zaniebot zaniebot added risk:0 No meaningful change to product, state, release, or automation behavior. priority:4 Low: worthwhile tests, refactors, or maintenance with modest immediate benefit. size:1 Small: one localized behavior with straightforward tests or documentation checks. labels Sep 23, 2026
@zaniebot
zaniebot changed the base branch from zb/future-20260912-interpreter-cache-ctime-base to main October 7, 2026 18:58
@zanieb
zanieb marked this pull request as ready for review October 7, 2026 19:20
@astral-automations-bot

Copy link
Copy Markdown

Promoted to #22310.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal:ci-flake Related to internal CI flakes internal:testing Internal testing of behavior internal A refactor or improvement that is not user-facing priority:4 Low: worthwhile tests, refactors, or maintenance with modest immediate benefit. risk:0 No meaningful change to product, state, release, or automation behavior. size:1 Small: one localized behavior with straightforward tests or documentation checks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants