Skip to content

TestLoadProviderCommandTimeout waits for child completion on Windows #683

Description

@PierrunoYT

Summary

TestLoadProviderCommandTimeout consistently takes about 10.2 seconds on Windows even though LoadProviderCommand has a 5-second timeout. The test allows up to 9 seconds on Windows, so it fails.

Reproduction

go test ./internal/config -run '^TestLoadProviderCommandTimeout$' -count=1 -v

Observed repeatedly:

timeout returned after 10.2s, want roughly 5s

Environment: Go 1.26.5, Windows amd64. Observed at upstream commit 6fc1220.

Relevant code

  • internal/config/command.go: the timer fires after five seconds, calls terminateCommandProcess(cmd), then blocks on <-done.
  • internal/config/process_windows.go: termination invokes taskkill /T /F and then cmd.Process.Kill().
  • internal/config/command_test.go: the fixture launches a ten-second PowerShell Start-Sleep child and expects completion within nine seconds on Windows.

Expected behavior

The provider command and its descendants should be terminated promptly after the five-second timeout, and the call should return within the Windows allowance.

Actual behavior

The call returns around the fixture's natural ten-second completion, suggesting the process-tree termination or wait path is not promptly releasing the command.

Suggested fix

Make Windows provider-command termination reliably kill the complete process tree without waiting for the sleeping child to exit naturally. Add a regression assertion that the timeout returns close to five seconds and leaves no child process behind.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions