From a75e10a32a6f6d5f392d59cef22f030ba9cf7016 Mon Sep 17 00:00:00 2001 From: Ramon Smits Date: Wed, 9 Sep 2026 16:54:20 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Provision=20WSL=20and=20the=20te?= =?UTF-8?q?st=20containers=20after=20the=20build=20instead=20of=20alongsid?= =?UTF-8?q?e=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows jobs have died with "The hosted runner lost communication with the server" while the build and the 8 GB WSL2 VM were competing for the runner's 16 GB. The WSL, SQL Server, PostgreSQL, RabbitMQ and IBM MQ setup steps now wait for the build like the Azure steps already did. --- .github/workflows/ci.yml | 48 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bfd9289969..529114017a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,16 +90,6 @@ jobs: id: build background: true run: dotnet build tests.proj --configuration Release -graph - # Provisions the WSL2 Docker host that the SQL Server, PostgreSQL, RabbitMQ and IBM MQ containers - # run in on Windows. A no-op on Linux, but still run there so those actions see the same - # environment variables on both runners. - - name: Setup WSL - if: contains(fromJSON('["RabbitMQ", "SqlServer", "PostgreSql", "IBMMQ"]'), matrix.test-category) - uses: Particular/setup-wsl-action@v1.2.0 - with: - # The action defaults to 4GB. The runner has 16GB and the build runs concurrently with the - # container starting up, so give the VM real headroom. - memory: 8GB # there is an issue with az cli and python 3.14, so for now we need to pin it # once the issue is resolved it should be able to be re-floated # https://github.com/Azure/azure-cli/issues/32980. @@ -116,6 +106,30 @@ jobs: python -m pip install --upgrade pip python -m pip install --user "azure-cli==2.64.0" echo "$HOME/.local/bin" >> "$GITHUB_PATH" + - name: Setup SQS environment variables + if: matrix.test-category == 'SQS' + run: | + echo "AWS_REGION=${{ secrets.AWS_REGION }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append + echo "AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append + echo "AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append + + # Cleanup of queues starting with `GHA-` handled by https://github.com/Particular/NServiceBus.AmazonSQS/blob/master/.github/workflows/tests-cleanup.yml + $connectString = "AccessKeyId=${{ secrets.AWS_ACCESS_KEY_ID }};SecretAccessKey=${{ secrets.AWS_SECRET_ACCESS_KEY }};Region=${{ secrets.AWS_REGION }};QueueNamePrefix=GHA-${{ github.run_id }}" + echo "ServiceControl_TransportTests_SQS_ConnectionString=$connectString" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append + # The Azure steps below create real cloud resources, so they sit behind the wait as well. + - name: Wait for build + wait: build + # Provisions the WSL2 Docker host that the SQL Server, PostgreSQL, RabbitMQ and IBM MQ containers + # run in on Windows. A no-op on Linux, but still run there so those actions see the same + # environment variables on both runners. It and the container setups run after the build on + # purpose: with the VM and the build competing for the runner's memory, jobs have died with "The + # hosted runner lost communication with the server". + - name: Setup WSL + if: contains(fromJSON('["RabbitMQ", "SqlServer", "PostgreSql", "IBMMQ"]'), matrix.test-category) + uses: Particular/setup-wsl-action@v1.2.0 + with: + # The action defaults to 4GB. The runner has 16GB, so give the VM real headroom. + memory: 8GB - name: Setup SQL Server uses: Particular/install-sql-server-action@v3.0.0 if: matrix.test-category == 'SqlServer' @@ -148,20 +162,6 @@ jobs: if: matrix.test-category == 'IBMMQ' with: connection-string-name: ServiceControl_TransportTests_IBMMQ_ConnectionString - - name: Setup SQS environment variables - if: matrix.test-category == 'SQS' - run: | - echo "AWS_REGION=${{ secrets.AWS_REGION }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append - echo "AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append - echo "AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append - - # Cleanup of queues starting with `GHA-` handled by https://github.com/Particular/NServiceBus.AmazonSQS/blob/master/.github/workflows/tests-cleanup.yml - $connectString = "AccessKeyId=${{ secrets.AWS_ACCESS_KEY_ID }};SecretAccessKey=${{ secrets.AWS_SECRET_ACCESS_KEY }};Region=${{ secrets.AWS_REGION }};QueueNamePrefix=GHA-${{ github.run_id }}" - echo "ServiceControl_TransportTests_SQS_ConnectionString=$connectString" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append - # Everything above provisions local containers, so it overlaps the build freely. The Azure steps - # below create real cloud resources, so they sit behind the wait too. - - name: Wait for build - wait: build - name: Azure login uses: azure/login@v3.0.2 if: matrix.test-category == 'AzureServiceBus' || matrix.test-category == 'AzureStorageQueues'