Skip to content

Refactor Windows service helpers for testability and improve RestartServiceWithVerify.#776

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_903171985
Open

Refactor Windows service helpers for testability and improve RestartServiceWithVerify.#776
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_903171985

Conversation

@copybara-service
Copy link
Copy Markdown

Refactor Windows service helpers for testability and improve RestartServiceWithVerify.

Introduced mockable variables for Windows service management functions and time.Sleep in helpers_windows.go. Updated all service-related functions to use these new variables. Improved RestartServiceWithVerify to more accurately handle service state transitions by querying the actual service state immediately after restart and looping until the service is in the svc.Running state. Added TestRestartServiceWithVerify in helpers_windows_test.go to test various service restart scenarios, including pending states and timeouts.

…erviceWithVerify.

Introduced mockable variables for Windows service management functions and time.Sleep in helpers_windows.go. Updated all service-related functions to use these new variables. Improved RestartServiceWithVerify to more accurately handle service state transitions by querying the actual service state immediately after restart and looping until the service is in the svc.Running state. Added TestRestartServiceWithVerify in helpers_windows_test.go to test various service restart scenarios, including pending states and timeouts.

PiperOrigin-RevId: 903171985
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.

1 participant