Skip to content

Commit

Permalink
test: reduce flaky test results on CI
Browse files Browse the repository at this point in the history
On CI, we have been getting flaky failed test functions because of expectation timeouts in this block of code. This is happening because the performance of CI machines is slower and processes could take longer to execute on CI.

We have a [ticket](https://linear.app/customerio/issue/MBL-95/reduce-time-it-takes-for-test-suite-to-execute-by-replacing-sleep#comment-ef5545d3) to try and replace the timeout functionality altogether, but until then, this change fixes flaky failed tests by bumping the timeout.

commit-id:25a6701b
  • Loading branch information
levibostian committed Feb 22, 2024
1 parent f67ec86 commit 35f08c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Tests/MessagingInApp/MessagingInAppImplementationTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ extension MessagingInAppImplementationTest {
expectation.fulfill()
}
// Wait for the expectations to be fulfilled, with a timeout slightly longer than given timeout
wait(for: [expectation], timeout: timeoutInSeconds + 0.1)
// Note: On CI, we experienced flakiness if the timeout value was only 0.1 seconds longer then the given timeout value.
wait(for: [expectation], timeout: timeoutInSeconds + 0.5)
}
}

0 comments on commit 35f08c3

Please sign in to comment.