Set UseWindowsLegacyProcessStrategy to false by default
What does this MR do?
!2739 (merged) introduced this feature flag as a way to improve the shutdown procedure on Windows. It has been around for about 3 years.
This change also fixes a termination bug in integration tests. On
Windows, a CTRL-C signal sent to terminate a job would be received
also by the Go interpreter (since Go 1.17: https://github.com/golang/go/blob/ccbc725f2d678255df1bd326fa511a492aa3a0aa/src/runtime/os_windows.go#L539), which would terminate the go test
invocation and prematurely abort tests. As described in
https://learn.microsoft.com/en-us/windows/console/generateconsolectrlevent,
creating a new process group via CREATE_NEW_PROCESS_GROUP
allows the
call to GenerateConsoleCtrlEvent
to target that specific process
group.
Relates to #37395 (closed)
What's the best way to test this MR?
On Windows, attempt to run:
go test -v -tags integration -run "^TestBuildCancel$|^TestBuildGitFetchStrategyFallback$" gitlab.com/gitlab-org/gitlab-runner/executors/custom gitlab.com/gitlab-org/gitlab-runner/executors/shell
On this branch, the tests run. On master
, no output is shown.