diff --git a/scripts/test-utils.ps1 b/scripts/test-utils.ps1 index f34f4bcec..d72311ffd 100644 --- a/scripts/test-utils.ps1 +++ b/scripts/test-utils.ps1 @@ -46,7 +46,7 @@ function Parse-TestResults([string] $Path) { Inconclusive = [int]$testRun.inconclusive Skipped = [int]$testRun.skipped Duration = [double]$testRun.duration - Success = $testRun.result -eq "Passed" + Success = [int]$testRun.total -gt 0 -and [int]$testRun.failed -eq 0 FailedTests = @() } diff --git a/scripts/unity-test-cli.ps1 b/scripts/unity-test-cli.ps1 index fce438de6..05b0d4d76 100644 --- a/scripts/unity-test-cli.ps1 +++ b/scripts/unity-test-cli.ps1 @@ -43,6 +43,6 @@ function Invoke-UnityHeadlessTest( Skipped = $summary.Skipped Inconclusive = $summary.Inconclusive FailedTests = $summary.FailedTests - Success = $run.ExitCode -eq 0 -and $summary.Success -and $summary.Inconclusive -eq 0 + Success = $run.ExitCode -eq 0 -and $summary.Success } } diff --git a/scripts/unity-test-pipeline.ps1 b/scripts/unity-test-pipeline.ps1 index 892bdc60d..8b2f8bf29 100644 --- a/scripts/unity-test-pipeline.ps1 +++ b/scripts/unity-test-pipeline.ps1 @@ -73,7 +73,7 @@ function Get-TestSummary([string] $requestedMode, [object] $result) { } }) - $success = $summary.Total -gt 0 -and $summary.Failed -eq 0 -and $summary.Inconclusive -eq 0 + $success = $summary.Total -gt 0 -and $summary.Failed -eq 0 [pscustomobject]@{ Mode = $result.Mode Duration = $result.Duration @@ -109,7 +109,7 @@ function Invoke-UnityPipelineTests( } if ($testPlatform -eq "playmode") { - $started = Invoke-UnityPipelineCommand -ProjectPath $projectPath -Command "run_tests" -CommandArguments ($commandArguments + @("--async_tests", "true")) + $started = Invoke-UnityPipelineCommand -ProjectPath $projectPath -Command "run_tests" -CommandArguments ($commandArguments + @("--async_tests", "true")) -TimeoutSeconds ($timeoutSeconds + 30) if (-not $started.success) { throw "Unity PlayMode tests could not start: $($started.error)" } diff --git a/src/Sentry.Unity/Integrations/AnrIntegration.cs b/src/Sentry.Unity/Integrations/AnrIntegration.cs index ad4f7f0b9..1d5c42395 100644 --- a/src/Sentry.Unity/Integrations/AnrIntegration.cs +++ b/src/Sentry.Unity/Integrations/AnrIntegration.cs @@ -195,8 +195,11 @@ internal AnrWatchDogSingleThreaded(IDiagnosticLogger? logger, SentryMonoBehaviou logger?.LogDebug("Stopping ANR detection coroutine."); _watch.Stop(); - MonoBehaviour.StopCoroutine(_updateUiStatusCoroutine); - _updateUiStatusCoroutine = null; + if (_updateUiStatusCoroutine is not null) + { + MonoBehaviour.StopCoroutine(_updateUiStatusCoroutine); + _updateUiStatusCoroutine = null; + } }; MonoBehaviour.ApplicationResuming += () => {