-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix flakiness of tests on Windows requiring ports in the dynamic range
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<# | ||
.SYNOPSIS | ||
This script ensures that the ports required by the default configuration of the collector are available. | ||
.DESCRIPTION | ||
Certain runs on GitHub Actions sometimes have ports required by the default configuration reserved by other | ||
applications via the WinNAT service. | ||
#> | ||
|
||
#Requires -RunAsAdministrator | ||
|
||
netsh interface ip show excludedportrange protocol=tcp | ||
|
||
Stop-Service winnat | ||
|
||
# Only port in the dynamic range that is being, from time to time, reserved by other applications. | ||
netsh interface ip add excludedportrange protocol=tcp startport=55678 numberofports=2 | ||
|
||
Start-Service winnat | ||
|
||
netsh interface ip show excludedportrange protocol=tcp |