Skip to content

Commit fb4bb17

Browse files
[infra] Ensure test-threadSafety.ps1 fails (#6302)
Co-authored-by: Alan West <[email protected]>
1 parent b884697 commit fb4bb17

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

build/scripts/test-threadSafety.ps1

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
11
param(
2-
[Parameter()][string]$coyoteVersion="1.7.10",
2+
[Parameter()][string]$coyoteVersion="1.7.11",
33
[Parameter(Mandatory=$true)][string]$testProjectName,
44
[Parameter(Mandatory=$true)][string]$targetFramework,
55
[Parameter()][string]$categoryName="CoyoteConcurrencyTests",
66
[Parameter()][string]$configuration="Release"
77
)
88

9+
$ErrorActionPreference = "Stop"
10+
911
$env:OTEL_RUN_COYOTE_TESTS = 'true'
1012

1113
$rootDirectory = Get-Location
1214

1315
Write-Host "Install Coyote CLI."
14-
dotnet tool install --global Microsoft.Coyote.CLI
16+
dotnet tool install --global Microsoft.Coyote.CLI --version $coyoteVersion
17+
18+
if ($LASTEXITCODE -ne 0) {
19+
throw "Microsoft.Coyote.CLI installation failed with exit code $LASTEXITCODE"
20+
}
1521

1622
Write-Host "Build $testProjectName project."
1723
dotnet build "$rootDirectory/test/$testProjectName/$testProjectName.csproj" --configuration $configuration
1824

25+
if ($LASTEXITCODE -ne 0) {
26+
throw "dotnet build failed with exit code $LASTEXITCODE"
27+
}
28+
1929
$artifactsPath = Join-Path $rootDirectory "test/$testProjectName/bin/$configuration/$targetFramework"
2030

2131
Write-Host "Generate Coyote rewriting options JSON file."
@@ -29,6 +39,13 @@ $RewriteOptionsJson | ConvertTo-Json -Compress | Set-Content -Path "$rootDirecto
2939
Write-Host "Run Coyote rewrite."
3040
coyote rewrite "$rootDirectory/test/$testProjectName/rewrite.coyote.json"
3141

42+
if ($LASTEXITCODE -ne 0) {
43+
throw "coyote rewrite failed with exit code $LASTEXITCODE"
44+
}
45+
3246
Write-Host "Execute re-written binary."
3347
dotnet test "$artifactsPath/$testProjectName.dll" --framework $targetFramework --filter CategoryName=$categoryName
3448

49+
if ($LASTEXITCODE -ne 0) {
50+
throw "dotnet test failed with exit code $LASTEXITCODE"
51+
}

0 commit comments

Comments
 (0)