diff --git a/features/fixtures/mazerunner/cxx-scenarios-bugsnag/src/main/java/com/bugsnag/android/mazerunner/scenarios/EventTooBigScenario.kt b/features/fixtures/mazerunner/cxx-scenarios-bugsnag/src/main/java/com/bugsnag/android/mazerunner/scenarios/EventTooBigScenario.kt index 54395b0196..b801f25dc0 100644 --- a/features/fixtures/mazerunner/cxx-scenarios-bugsnag/src/main/java/com/bugsnag/android/mazerunner/scenarios/EventTooBigScenario.kt +++ b/features/fixtures/mazerunner/cxx-scenarios-bugsnag/src/main/java/com/bugsnag/android/mazerunner/scenarios/EventTooBigScenario.kt @@ -39,6 +39,12 @@ class EventTooBigScenario( breadcrumbCount = args[2].toInt() config.setTelemetry(config.getTelemetry() + Telemetry.USAGE) } + // Remove all threads from the error as the stack traces vary in size enough to trigger + // different trimming behavior, and cause the scenarios to fail + config.addOnError { event -> + event.threads.clear() + true + } } external fun nativeCrash(value: Int): Int diff --git a/features/full_tests/trimming.feature b/features/full_tests/trimming.feature index 39b060e678..899361a29f 100644 --- a/features/full_tests/trimming.feature +++ b/features/full_tests/trimming.feature @@ -56,7 +56,7 @@ Feature: Excess data is trimmed when the payload is too big Then I wait to receive an error And the error is valid for the error reporting API version "4.0" for the "Android Bugsnag Notifier" notifier And the exception "message" equals "EventTooBigScenario" - And the event has less than 99 breadcrumbs + And the event has less than 100 breadcrumbs Then the event last breadcrumb has a message that matches the regex "Removed, along with [0-9]+ older breadcrumbs, to reduce payload size" And the event "usage.system.breadcrumbsRemoved" is not null And the event "usage.system.breadcrumbBytesRemoved" is not null @@ -64,7 +64,7 @@ Feature: Excess data is trimmed when the payload is too big Then I wait to receive an error And the error is valid for the error reporting API version "4.0" for the "Android Bugsnag Notifier" notifier And the exception "message" equals "EventTooBigScenario" - And the event has less than 99 breadcrumbs + And the event has less than 100 breadcrumbs Then the event last breadcrumb has a message that matches the regex "Removed, along with [0-9]+ older breadcrumbs, to reduce payload size" And the event "usage.system.breadcrumbsRemoved" is not null And the event "usage.system.breadcrumbBytesRemoved" is not null @@ -75,7 +75,7 @@ Feature: Excess data is trimmed when the payload is too big Then I wait to receive an error And the error is valid for the error reporting API version "4.0" for the "Android Bugsnag Notifier" notifier And the exception "message" equals "EventTooBigScenario" - And the event has less than 99 breadcrumbs + And the event has less than 100 breadcrumbs Then the event last breadcrumb has a message that matches the regex "Removed, along with [0-9]+ older breadcrumbs, to reduce payload size" And the event "usage.system.breadcrumbsRemoved" is not null And the event "usage.system.breadcrumbBytesRemoved" is not null @@ -88,9 +88,9 @@ Feature: Excess data is trimmed when the payload is too big Then I wait to receive an error And the error is valid for the error reporting API version "4.0" for the "Android Bugsnag Notifier" notifier And the exception "message" equals "Empty list doesn't contain element at index 0." - And the event has 98 breadcrumbs - And the event "breadcrumbs.97.name" equals "Removed, along with 2 older breadcrumbs, to reduce payload size" - And the event "usage.system.breadcrumbsRemoved" equals 3 + And the event has 99 breadcrumbs + And the event "breadcrumbs.98.name" equals "Removed, along with 1 older breadcrumbs, to reduce payload size" + And the event "usage.system.breadcrumbsRemoved" equals 2 And the event "usage.system.breadcrumbBytesRemoved" is not null # Note: Disabled until native hard limits are removed.