Skip to content

Make the Web startup test independent of warm-up timing - #3753

Merged
ashhart merged 5 commits into
ashhart:mainfrom
AIflow-Labs:codex/web-startup-ready-stand-in
Nov 21, 2026
Merged

ashhart merged 5 commits into
ashhart:mainfrom
AIflow-Labs:codex/web-startup-ready-stand-in

Conversation

@AIFlowML

@AIFlowML AIFlowML commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

The standalone Web loopback test sometimes reads the stand-in while it still reports warming. Set its fixture to ready before probing it so the result is independent of when pytest imports the stand-in. The health, model-list, relay and proxy-control assertions are unchanged.

  • Issue: Fixes Web startup test depends on the stand-in warm-up clock #3752.
  • Stacked on: main at af9777b4945a03be8266d6fe925e577bd62f32e7. One test-only commit.
  • atc overlap --json: Checked against upstream/main around 02:04 UTC on 18 Nov. Zero overlaps found in the capped ATC scan. The independent file audit covered all 447 open PRs, with 43 full-file follow-ups including rename origins, and found zero shared paths. Actual test merges with main and all 16 existing AIFlowML heads were clean.

Checks on this head

  • Head commit: ed0446b0e9c7fcc2b83e9c5cd71e4131db72310b.
  • Lean checker, python3 tools/zig/lean_check.py, on the base and on this head: 221 inherited findings on each, zero new. python3 tools/pr_check.py --base upstream/main reported zero errors and zero warnings.
  • Tests run:
    • From web/, uv run --no-project --python 3.12 --with-editable '.[dev]' pytest -q tests/test_network_startup.py::test_loopback_engine_and_relay_bypass_an_active_system_proxy failed 5/5 on pristine main, with starting instead of running. This head passed 5/5 standalone runs on each of Python 3.11 and 3.12.
    • Full standalone pytest -q on Python 3.12: 456 passed, one Linux-only systemd skip, one inherited failure. Pristine main gives the same 1.2.4 versus 1.2.9 version assertion in test_stand_in_reports_build_version_not_an_old_path_binary. Check the packaged Web version on native release bumps #3745 fixes it independently.
    • In a temporary tree that combines this head with the 16 open AIFlowML heads, including Check the packaged Web version on native release bumps #3745, full pytest -q -rs passed on Python 3.11 and 3.12. Each run had 460 passed, zero failures and one Linux-only systemd skip.
    • zig build test test-golden -Dcpu=apple_m1 --summary all on Apple M5 Max, macOS 27.2, Zig 0.17.0: 890/890 steps succeeded with 14,839 passed, 120 skipped and zero failed. Server goldens recorded 13 known differences and zero unexpected. ruff check . in web/, Zig format check and git diff --check passed.
  • CI: The No GPU workflow passed all eight applicable checks, with two scheduled-only skips. Format, Web package and UI passed. Python 3.12 recorded 456 passes, one skip and the same inherited 1.2.4 versus 1.2.9 version assertion tracked by Web stand-in still reports 1.2.4 after native version bumps #3739 and fixed by Check the packaged Web version on native release bumps #3745. Python 3.11 was cancelled. The warm-up test passed in the hosted Python 3.12 run.
  • Not run, and why: Local validation used macOS. The systemd case is Linux-only. Real model serving is outside this fixture change.

Current-main integration check

Tested local merge 1a2e343e922caf326382298c6e19972631536c45 on upstream 144964f8dcee8e569c1570f8cbc33305d4d48ea8 with the five open AIFlowML heads. The Web matrix passed 500 cases and skipped one on each of Python 3.11 and 3.12 on the M5 Max. Both runs failed the same stand-in version assertion on the newer 1.3.0 development tree, which still packages 1.2.10. The isolated assertion also fails on untouched main. The original 1.2.4 vs. 1.2.9 mismatch was corrected by #3745. Current version regression.

Receipt

n/a. This changes a test fixture’s start timestamp. No engine or Web runtime code changed.

Checklist

  • The title and scope match the submitted head.
  • The existing regression fails on the unmodified fixture and passes with the changed fixture.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No private data, machine names, internal hosts or local paths in the diff or commit. No AI attribution lines.

Igor Lessio - AIFLOW LABS

@ashhart

ashhart commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Thanks @AIFlowML. The cause is clear: State.started is set when the stand-in module is imported, so for the first three seconds it reports warming, and whether this test sees starting depends on what ran before it.

Setting State.started to 0 through monkeypatch before serve makes the stand-in ready from the start. monkeypatch restores it afterwards, so other tests still see the real warm-up. Only the test changes, and the health, model-list, relay and proxy assertions are untouched.

The one other failure in your full-suite run is the version check that #3745 fixes. Nothing to change here.

  • Synthena

@eXsoR65

eXsoR65 commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Verified on Linux x86_64 (4 cores, 7 GB RAM, no GPU), Python 3.12.16 via uv 0.13.9, pytest 9.2.0, at head ed0446b0e against base af9777b49 and current main dc71af9d2.

  • Target test at the declared base: 5/5 failed with assert 'starting' == 'running' — Web startup test depends on the stand-in warm-up clock #3752 reproduces cross-platform. At this head: 5/5 passed standalone (~1.1 s each) and in-file.
  • Full suite at this head with the temp dir on a filesystem with 16 GB free: 456 passed, 1 failed, 1 skipped (native capabilities binary absent) — matches the macOS receipt in the description. The one failure is the inherited stand-in version drift (native-version.json 1.2.4 vs build.zig.zon 1.2.9 at this head; 1.3.0 vs 1.3.2 on current main), tracked by Web stand-in still reports 1.2.4 after native version bumps #3739 / Check the packaged Web version on native release bumps #3745 / Web stand-in still reports 1.2.10 after the 1.3.0 version bump #4074.
  • The Linux-only systemd cases run here: tests/test_service.py + test_b17_systemd_quoting_escapes_what_it_quotes → 7 passed. ruff check . clean.
  • With the default 3.9 GB tmpfs /tmp, 16 living/storage/lessons tests fail the "keep 5 GB free" disk guard identically on this head and on pristine main (17 failed / 440 passed / 1 skipped vs 17 failed / 482 passed / 1 skipped; identical failure sets). A larger TMPDIR turns all 16 green. Zero PR-caused failures.
  • Note: web: the loopback startup test sets the stand-in past its warm-up clock #4086 (merged 2026-11-20, 8614cbe83) already sets the stand-in past its warm-up clock on main (State.started = time.time() - 4 after serve); the target passes 5/5 on current main without this PR. Both variants defeat the import-time clock since the handler reads State.started per request. This PR can be closed as superseded, or one variant chosen.

— eXsoR65's AI agent (DeepSeek Harness): this verification was run by eXsoR65's AI coding agent at their direction; eXsoR65 reviewed and approved this comment before posting.

@AIFlowML

AIFlowML commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks @eXsoR65 for the Linux rerun. I rechecked our original report on M5 Max. From web/, uv run --frozen --extra dev pytest -q tests/test_network_startup.py::test_loopback_engine_and_relay_bypass_an_active_system_proxy failed with starting versus running on the original base af9777b49 and passed on current main 37fa51d23. Ash’s warm-up fixture fix already covers the reported failure. This PR can be closed as superseded. The current stand-in mismatch (packaged 1.3.0 versus manifest 1.3.2) is a recurrence of the earlier version-sync failure recorded in closed issue #4074.

I checked the #4292 train d4d323fdf against 3025ce9d2. The startup test now sets the stand-in clock both before and after serve. After regenerating the unrelated version fixture locally, all seven focused Web tests pass with both overrides. Restoring the startup test file from main, which retains Ash’s already-landed override, passes the same seven cases.

Igor Lessio - AIFLOW LABS

@ashhart
ashhart force-pushed the codex/web-startup-ready-stand-in branch from ed0446b to cc96ddb Compare November 21, 2026 04:53
@ashhart
ashhart merged commit a8aed33 into ashhart:main Nov 21, 2026
2 of 15 checks passed
ashhart added a commit that referenced this pull request Nov 21, 2026
@ashhart

ashhart commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Thank you @AIFlowML. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes.

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.

Web startup test depends on the stand-in warm-up clock

3 participants