Skip to content

Get-DbaExternalProcess, Stop-DbaExternalProcess - Restart only the Restart instance in the tests - #10730

Open
andreasjordan wants to merge 1 commit into
developmentfrom
tests-externalprocess-restart-only-restart-instance
Open

andreasjordan wants to merge 1 commit into
developmentfrom
tests-externalprocess-restart-only-restart-instance

Conversation

@andreasjordan

@andreasjordan andreasjordan commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

The AfterAll of Get-DbaExternalProcess.Tests.ps1 and Stop-DbaExternalProcess.Tests.ps1 restarts the engine to release the temporary sql file, with

Restart-DbaService -ComputerName $TestConfig.InstanceRestart -Type Engine -Force

-ComputerName with a DbaInstanceParameter uses only the computer part, so every engine on that host restarts, not only the Restart instance. On the lab, where the instances of a test set share one host, this restarted the Single instance twice during the parallel full runs of 2026-09-19/20 (SQL05 at 16:46 and SQL03 at 20:33) in the middle of other test files. On CI all instances of a lane live on the runner as well, so the same happens there.

Both files now pass -SqlInstance $TestConfig.InstanceRestart instead, which Get-DbaService resolves to that one instance.

Test plan

  • Both files green on PowerShell 7 and Windows PowerShell 5.1 (2 and 3 tests each).
  • Lab: sqlserver_start_time of the three SQL03 instances before and after each run; only the Restart instance restarted.
Instance Role Before After pwsh run After 5.1 run
SQL03\SQL2019 Single 17:07:13 17:07:13 17:07:13
SQL03\SQL2025 Multi1/Hadr 17:07:16 17:07:16 17:07:16
SQL03\SQL2022 Restart 17:19:14 20:22:17 20:23:23

With the old line, the 2026-09-19/20 runs show all three instances of the host restarting at the moment these files ran.

created by Claude and reviewed by Andreas Jordan

🤖 Generated with Claude Code

…start instance in the tests

(do *DbaExternalProcess)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@andreasjordan
andreasjordan marked this pull request as ready for review September 20, 2026 19:48

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

Reviewed the complete patch at this exact head, including service-resolution behavior, cleanup scope, both affected test files, discussions, and the applicable passing Azure restart lane. No material defects found.

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