diff --git a/.github/workflows/dotnet-ubuntu.yml b/.github/workflows/dotnet-ubuntu.yml index bd31e75..3f1078f 100644 --- a/.github/workflows/dotnet-ubuntu.yml +++ b/.github/workflows/dotnet-ubuntu.yml @@ -26,9 +26,9 @@ jobs: - name: Run tests and collect coverage run: | - dotnet test -c Release ./src --verbosity normal --no-build --no-restore \ + dotnet test -c Release ./src --verbosity normal --no-build --no-restore \ --collect:"XPlat Code Coverage" --results-directory ./TestResults/ \ - /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura \ + /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura \ /p:CoverletOutput=./TestResults/coverage.cobertura.xml - name: List files in TestResults directory diff --git a/src/Downloader.Test/UnitTests/PauseTokenTest.cs b/src/Downloader.Test/UnitTests/PauseTokenTest.cs index 94fbab3..74cb1a5 100644 --- a/src/Downloader.Test/UnitTests/PauseTokenTest.cs +++ b/src/Downloader.Test/UnitTests/PauseTokenTest.cs @@ -43,7 +43,7 @@ public async Task TestPauseTaskWithPauseToken() checkTokenStateIsPaused &= pts.IsPaused; await Task.Delay(1); hasRunningTask &= (_actualPauseCount > expectedCount); - expectedCount = _actualPauseCount; + Interlocked.Exchange(ref expectedCount, _actualPauseCount); } await cts.CancelAsync();