From fd9f58af79bb9b9fb0fffa4368e1bb8b9a86106d Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Thu, 29 Oct 2026 11:54:32 +0100 Subject: [PATCH] Enable app hang tracking only in the app hang integration test --- .../Scripts/IntegrationOptionsConfiguration.cs | 4 ++-- test/Scripts.Integration.Test/Scripts/IntegrationTester.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/Scripts.Integration.Test/Scripts/IntegrationOptionsConfiguration.cs b/test/Scripts.Integration.Test/Scripts/IntegrationOptionsConfiguration.cs index f6afcc406..e96f77b6f 100644 --- a/test/Scripts.Integration.Test/Scripts/IntegrationOptionsConfiguration.cs +++ b/test/Scripts.Integration.Test/Scripts/IntegrationOptionsConfiguration.cs @@ -45,8 +45,8 @@ public override void Configure(SentryUnityOptions options) options.DisableAnrIntegration(); #pragma warning restore CS0618 // Type or member is obsolete - // App Hang tracking - options.EnableAppHangTracking = true; + // Only for the app hang test: on a slow device the 2s watchdog fires in the other tests too, and the hang event carries their tags. + options.EnableAppHangTracking = IntegrationTester.GetTestArg() == "app-hang-capture"; options.AppHangTimeout = TimeSpan.FromSeconds(2); // Runtime initialization for integration tests diff --git a/test/Scripts.Integration.Test/Scripts/IntegrationTester.cs b/test/Scripts.Integration.Test/Scripts/IntegrationTester.cs index fe38471cb..68936f746 100644 --- a/test/Scripts.Integration.Test/Scripts/IntegrationTester.cs +++ b/test/Scripts.Integration.Test/Scripts/IntegrationTester.cs @@ -85,9 +85,9 @@ public void Start() #if UNITY_IOS && !UNITY_EDITOR // .NET `Environment.GetCommandLineArgs()` doesn't seem to work on iOS so we get the test arg in Objective-C [DllImport("__Internal", EntryPoint="getTestArgObjectiveC")] - private static extern string GetTestArg(); + internal static extern string GetTestArg(); #else - private static string GetTestArg() + internal static string GetTestArg() { string arg = null; #if UNITY_EDITOR