Skip to content

fix(#367): derive subprocess cwd from __file__ in lifespan test#368

Merged
NoveliaYuki merged 1 commit into
projects/refactor/kbserver-lamb-integrationfrom
fix/#367/portable-cwd-in-empty-token-test
May 11, 2026
Merged

fix(#367): derive subprocess cwd from __file__ in lifespan test#368
NoveliaYuki merged 1 commit into
projects/refactor/kbserver-lamb-integrationfrom
fix/#367/portable-cwd-in-empty-token-test

Conversation

@NoveliaYuki
Copy link
Copy Markdown
Collaborator

Purpose

The empty-token startup-guard test in the new KB server hardcoded its subprocess cwd to one developer's local Linux path. Outside that one machine the subprocess could not start, so the test failed for the wrong reason on macOS, other Linux checkouts, and CI alike.

Changes

  • Resolve the lamb-kb-server/ repo root from the test file's own location (Path(__file__).resolve().parents[2]) and pass that to subprocess.run(..., cwd=...).
  • No other test in tests/integration/test_main_lifespan.py is touched; all 12 tests in the file still pass.

Related

The empty-token startup-guard test spawned its subprocess with cwd set
to a hardcoded absolute Linux path that only existed on one developer's
machine. Anywhere else the subprocess silently failed to start with a
working directory error, masking the actual guard behavior under test.
Resolve the repo root from the test file's location instead so the
test runs portably on macOS, Linux, and CI.
@NoveliaYuki NoveliaYuki added the bug Something isn't working label May 11, 2026
@NoveliaYuki NoveliaYuki self-assigned this May 11, 2026
@NoveliaYuki NoveliaYuki merged commit 8486ce4 into projects/refactor/kbserver-lamb-integration May 11, 2026
@NoveliaYuki NoveliaYuki deleted the fix/#367/portable-cwd-in-empty-token-test branch May 11, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant