Skip to content

test(lifecycle): the lifecycle world and journeys run on Windows - #4414

Merged
Daniel Meppiel (danielmeppiel) merged 11 commits into
mainfrom
danielmeppiel-t3-world-windows
Nov 21, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 11 commits into
mainfrom
danielmeppiel-t3-world-windows

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Description

The lifecycle journeys had never run on Windows. The first 3-OS run (44767346437) errored at fixture setup for every journey. This PR makes the lifecycle world and the journey runner work on Windows. It changes test code only; the product bugs the Windows run found have their own PRs (#4408, #4410, #4413).

Each layer was found from git's own stderr on Windows CI (diagnostic dispatches 44768509484 to 44772582489):

Layer Windows symptom Fix (tests only)
1 fatal: '$GIT_DIR' too big from APM's repo-scoped git config probe: pytest temp root plus world nesting plus apm_modules\.apm-resolution-staging\...\.git exceeds Git for Windows' path limit world/fixtures.py: on Windows the template and each per-test clone live under a short root (<temp drive>:\lw\, override APM_LIFECYCLE_SHORT_ROOT, falling back to tmp_path)
2 schannel: the revocation status is unknown cloning through the world's HTTPS proxy world/builder.py: on Windows the world's global gitconfig sets http.sslBackend = openssl, which APM inherits by design (#2545), so the fixture CA in GIT_SSL_CAINFO verifies
3 PermissionError [WinError 5] removing git's read-only pack files (builder scratch, cold-cache steps) world/clone.py remove_tree clears read-only bits; the builder, fixtures and runner use it
4 I1 "recorded hash does not match disk" on every install oracles.py I1 uses the product's compute_file_hash; the lock records line-ending-normalized hashes (apm#1952), so CRLF is not drift
5 key lines and goldens miss <APM_HOME>\apm.yml, build\my-plugin... journeys/normalize.py: on Windows a \ between path characters compares as /
6 prompts read the runner's console utils/apm_lifecycle_runner.py: children get stdin=DEVNULL, as in CI (on Windows NUL still reports a TTY, so J15 needs #4413)
7 J07: apm outdated misses the newer annotated tag strict Windows-only xfail on new issue #4417 (_WINDOWS_KNOWN in test_journeys.py)

After layers 1-5, Windows went from 1 failed + 25 errors to 11 failed, 15 passed. What remained was the product bugs below, the expectations fixed in #4396 (E01 docs, E03, E06, J11, P02), and J05 (routed separately).

Product bugs found here, each with its own PR:

Issue and approved scope

Issue: Refs #4094, Refs #4110

Human scope-approval comment: Windows journeys triage by the 0.37 Stream T lead and steward (Windows is a hard gate).

Does this PR complete the issue, or what remains? It is partial. J07 is a strict Windows-only expected failure on #4417; J05 is routed separately.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

Results:

Changelog

  • One line in one section under ## [Unreleased] in CHANGELOG.md.
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • N/A -- this PR does not change OpenAPM-observable behaviour.

…nfig probe fails (#4094)

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…$GIT_DIR too big') (#4094)

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…ts fixture CA verifies (#4094)

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…ng-normalized hash (apm#1952) (#4093)

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…compare paths with '/' separators (#4094, #4110)

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved lifecycle fixture issues can alter permissions outside the copied tree, bypass the temporary-directory fallback on allocation failures, and leak directories when template setup fails.

3 open issues
What changed in this PR

This test-only PR adapts the shared lifecycle world and journey runner for Windows. It addresses infrastructure failures while leaving the discovered product bugs to separate PRs.

Changes:

  • Add short Windows world paths, fixture-specific TLS configuration, and read-only file cleanup.
  • Align integrity checks and journey output comparisons with cross-platform behavior.
  • Disconnect child-process stdin to prevent prompts from reading the runner's console.
File Description
tests/​utils/​apm_lifecycle_runner.py Set child-process stdin to DEVNULL.
tests/​lifecycle/​world/​fixtures.py Allocate short Windows world paths and clean them up.
tests/​lifecycle/​world/​clone.py Add cleanup that clears read-only file permissions.
tests/​lifecycle/​world/​builder.py Configure Windows Git TLS and use shared cleanup.
tests/​lifecycle/​oracles.py Use line-ending-normalized hashes for integrity checks.
tests/​lifecycle/​journeys/​test_journeys.py Use shared cleanup for cold-cache steps.
tests/​lifecycle/​journeys/​normalize.py Normalize Windows path separators for output comparisons.
tests/​lifecycle/​conftest.py Register the new world-directory fixture.

Review effort: Balanced

raise FileNotFoundError(path)
for root, _dirs, files in os.walk(path):
for name in files:
os.chmod(os.path.join(root, name), stat.S_IWRITE | stat.S_IREAD)
Comment on lines +38 to +40
root.mkdir(parents=True, exist_ok=True)
except OSError:
return None
Comment on lines +66 to +73
template = build_template(base / "world")
try:
yield template
finally:
template.services.close()
if parent is not None:
with contextlib.suppress(OSError):
remove_tree(base)
This was referenced Nov 20, 2026
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit b151541 into main Nov 21, 2026
33 of 38 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-t3-world-windows branch November 21, 2026 05:24
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.

2 participants