Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistent payload #1949

Merged
8 commits merged into from
Nov 28, 2023
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions features/full_tests/trimming.feature
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ 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
And I close and relaunch the app
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
Expand All @@ -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
Expand All @@ -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.
Expand Down