Skip to content

Commit ac2ad19

Browse files
committed
Pre-populate .workspace/port.txt in SonarCloud job to avoid PortAllocation race across parallel test assemblies
1 parent 685de8d commit ac2ad19

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/code-style.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,14 @@ jobs:
261261
working-directory: application
262262
run: npx turbo run build --filter=@repo/emails
263263

264+
- name: Bootstrap Port Allocation
265+
# Pre-populate .workspace/port.txt so the parallel test assemblies in `dotnet test
266+
# PlatformPlatform.slnx` don't race PortAllocation.Load(): the loser sees a half-created
267+
# zero-byte file and throws "must contain a positive integer. Got: ''".
268+
run: |
269+
mkdir -p .workspace
270+
echo "9000" > .workspace/port.txt
271+
264272
- name: Run SonarCloud Analysis
265273
working-directory: application
266274
env:

0 commit comments

Comments
 (0)