Skip to content

test: isolate Windows registry and driver directories - #508

Merged
zeroshade merged 5 commits into
columnar-tech:mainfrom
eitsupi:fix/windows-test-isolation
Oct 23, 2026
Merged

zeroshade merged 5 commits into
columnar-tech:mainfrom
eitsupi:fix/windows-test-isolation

Conversation

@eitsupi

@eitsupi eitsupi commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Fix unsafe Windows tests discovered while reviewing #502 by isolating registry and driver directories in process-private temporary fixtures.

@eitsupi
eitsupi marked this pull request as draft September 30, 2026 03:33
@eitsupi
eitsupi marked this pull request as ready for review September 30, 2026 03:58

@zeroshade zeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks — the process-private hive + temp roots approach is sound, and every production registry access in config/dirs_windows.go now goes through ConfigLevel.key() → winregroot, so nothing escapes the fixture.

One thing I'd like to settle before merging: with this change, the Windows DBC_TEST_LEVEL_SYSTEM CI job no longer exercises real HKLM\SOFTWARE\ADBC\Drivers or C:\Program Files\ADBC\Drivers. Isolation is the right default for dev machines, but CI runners are disposable — could we add an opt-out (e.g. an env var that skips wintest.Setup()) so one Windows job keeps covering the real locations?

Smaller items:

  • assertLocalHTTPRoundTrip in the child process doesn't relate to registry/filesystem isolation — what is it guarding?
  • The RWMutexes in winregroot/systempath aren't needed since overrides are only set in TestMain before m.Run(); plain vars would do. Also consider merging the two packages.
  • With isolation in place, the test_registry build-tag gate on registry_test.go may no longer be necessary (follow-up).
  • Please squash on merge; 80a6eef is superseded by 6b4e99d.

@eitsupi

eitsupi commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

@zeroshade Updated in 8c873ab.

  • Added DBC_TEST_WINDOWS_REAL_LOCATIONS=1 to bypass the fixture explicitly, and enabled it only in the Windows System test step. Normal and User runs retain isolation. The process-isolation test skips in real-location mode.
  • Kept the child-process HTTP check and documented its purpose: I observed DNS/socket failures with the earlier global registry override. It checks that networking can initialize in a fresh process after fixture setup.
  • Kept the mutexes and separate packages, with comments clarifying their scope and responsibilities. The mutexes protect variable access; they do not make changing roots while tests are running safe.
  • Removed the test_registry gate and the corresponding CI flag, so registry tests now run by default on Windows.

@zeroshade zeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks — DBC_TEST_WINDOWS_REAL_LOCATIONS addresses my concern: the Windows System job now exercises the real HKLM/Program Files locations (confirmed in the CI log: TestSubcommandsSystem passes with the env set), while every other run stays isolated and Setup() never falls back to real roots implicitly. The rationale for keeping the loopback check, the mutexes and the package split is reasonable now that it's documented, and dropping the test_registry gate is a nice simplification.

Please squash on merge (80a6eef is superseded by 6b4e99d).

@zeroshade
zeroshade merged commit 220388d into columnar-tech:main Oct 23, 2026
15 checks passed
@eitsupi
eitsupi deleted the fix/windows-test-isolation branch October 24, 2026 00:41
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