Skip to content

Commit 3fc36d2

Browse files
Merge pull request #2173 from bugsnag/tms/flake-fixes
e2e test flake fixes
2 parents f36168e + 2827404 commit 3fc36d2

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

features/fixtures/mazerunner/jvm-scenarios/src/main/java/com/bugsnag/android/mazerunner/scenarios/DiscardOldSessionScenario.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ internal class DiscardOldSessionScenario(
3333

3434
fun waitForSessionFile() {
3535
val dir = sessionDir()
36-
while (dir.listFiles()!!.isEmpty()) {
36+
while (dir.listFiles().isNullOrEmpty()) {
3737
Thread.sleep(100)
3838
}
3939
}

features/full_tests/native_session_tracking.feature

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,17 @@ Feature: NDK Session Tracking
2424
And the error payload field "events.0.session.events.unhandled" equals 1
2525

2626
Scenario: Starting a session, notifying, followed by a C crash
27-
When I run "CXXSessionInfoCrashScenario" and relaunch the crashed app
28-
And I configure Bugsnag for "CXXSessionInfoCrashScenario"
27+
When I run "CXXSessionInfoCrashScenario"
2928
And I wait to receive a session
30-
And I wait to receive 3 errors
29+
And I wait to receive 2 errors
30+
And I discard the oldest session
3131
And I discard the oldest error
3232
And I discard the oldest error
33-
Then the error payload contains a completed handled native report
34-
And the event contains session info
33+
34+
And I relaunch the app after a crash
35+
And I configure Bugsnag for "CXXSessionInfoCrashScenario"
36+
# The fixture will now send the unhandled error plus the 2 handled errors
37+
# again, because they are invoked after the delivery of the session.
38+
And I wait to receive 3 errors
3539
And the error payload field "events.0.session.events.unhandled" equals 1
36-
And the error payload field "events.0.session.events.handled" equals 2
40+
And the error payload field "events.0.session.events.handled" equals 2

0 commit comments

Comments
 (0)