Windows: fix cert generation and run all tests; fix fd leaks and runner abort race by jay23606 · Pull Request #1174 · fortio/fortio · GitHub
Skip to content

Windows: fix cert generation and run all tests; fix fd leaks and runner abort race - #1174

Merged
ldemailly merged 7 commits into
fortio:masterfrom
jay23606:fix/windows-cert-gen
Oct 10, 2026
Merged

ldemailly merged 7 commits into
fortio:masterfrom
jay23606:fix/windows-cert-gen

Conversation

@jay23606

@jay23606 jay23606 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #970. Git Bash was rewriting OpenSSL's /CN=... subject argument as a Windows path. Disable MSYS path conversion for this script so certificates generate on Windows, which lets make test run the full test suite on Windows instead of only ./stats.

Running all tests on Windows surfaced the following, also fixed here:

Real bugs (all platforms)

  • rapi/data.go: TSV index leaked a file descriptor per successfully read .json file.
  • periodic: fileAccessLogger never closed its file; added Close().
  • periodic: runner could ignore Abort() when behind schedule — with sleepDuration <= 0 both the expired timer and the closed stop channel are ready and select picks randomly (~50% per iteration), causing occasional TestInfiniteDurationAndAbort failures (17 calls instead of ≤15, 730ms after abort).

Windows support / portability

  • fnet.Listen: detect Unix domain socket paths using the OS path separator too (C:\... paths were treated as TCP ports).
  • Tests: close access log / file handles before t.TempDir() cleanup, use t.TempDir() instead of /tmp, use https instead of domain service name (not in Go's builtin table with netgo/no /etc/services), skip the chmod-0 unreadable file check on Windows.
  • cli_test.txtar: accept the Windows "file not found" message; use taskkill instead of pkill on Windows.

Validation

  • Reproduced the original Git Bash/OpenSSL failure on the base revision; the updated script generated the CA, server, and client certificates under Git Bash.
  • Full test suite passes on Linux/macOS locally (-race -tags netgo) and on Windows CI.

(co - authored by owner ldemailly)

@codecov

codecov Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Comment thread Makefile Outdated
@ldemailly ldemailly changed the title Fix certificate generation in Git Bash on Windows Windows: fix cert generation and run all tests; fix fd leaks and runner abort race Oct 10, 2026

@ldemailly ldemailly 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.

I fixed a bunch of stuff in addition to the cert enabling -thanks

@ldemailly
ldemailly merged commit 35295f4 into fortio:master Oct 10, 2026
10 checks passed
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.

cert-gen failing on windows

2 participants