Skip to content

Commit

Permalink
Merge pull request #1792 from bugsnag/tms/flaky-retries
Browse files Browse the repository at this point in the history
Allow a single retry on flaky scenarios
  • Loading branch information
twometresteve authored Dec 22, 2022
2 parents ba7278d + ee29a62 commit a70142d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion features/full_tests/in_foreground.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ Feature: In foreground field populates correctly
And I send the app to the background for 5 seconds
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 event "app.inForeground" is false
# PLAT-9155 Flaky: the event "app.inForeground" is false
And the error is correct for "InForegroundScenario" or I allow a retry
6 changes: 4 additions & 2 deletions features/full_tests/native_event_tracking.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Feature: Synchronizing app/device metadata in the native layer
And I send the app to the background for 5 seconds
And I wait to receive an error
Then the error payload contains a completed handled native report
And the event "app.inForeground" is false
# PLAT-9155 Flaky: the event "app.inForeground" is false
And the error is correct for "CXXBackgroundNotifyScenario" or I allow a retry
And the event "app.durationInForeground" equals 0
And the event "app.duration" is greater than 0
And the event "context" string is empty
Expand All @@ -43,7 +44,8 @@ Feature: Synchronizing app/device metadata in the native layer
And I configure Bugsnag for "CXXDelayedCrashScenario"
And I wait to receive an error
Then the error payload contains a completed handled native report
And the event "app.inForeground" is false
# PLAT-9155 Flaky: the event "app.inForeground" is false
And the error is correct for "CXXDelayedCrashScenario" or I allow a retry
And the event "app.duration" is greater than 0
And the event "context" string is empty
And the event "unhandled" is true
7 changes: 7 additions & 0 deletions features/steps/android_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -261,5 +261,12 @@ def click_if_present(element)
when 'MultiThreadedStartupScenario'
Maze.dynamic_retry = true if message == 'You must call Bugsnag.start before any other Bugsnag methods'
Maze.check.equal 'Scenario complete', message
when 'InForegroundScenario', 'CXXBackgroundNotifyScenario', 'CXXDelayedCrashScenario'
begin
step 'the event "app.inForeground" is false'
rescue Test::Unit::AssertionFailedError
Maze.dynamic_retry = true
raise
end
end
end

0 comments on commit a70142d

Please sign in to comment.