-
Notifications
You must be signed in to change notification settings - Fork 205
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
Add semaphore to error store when flushing cached reports #270
Conversation
writeFakeError(); | ||
errorStore.flushOnLaunch(apiClient); | ||
errorStore.flushAsync(apiClient); | ||
assertEquals(1, requestCount.get()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Referring to a desk conversation: This assertion was failing inconsistently when the emulator was first launched with the error:
java.lang.AssertionError: expected:<1> but was:<0>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:834)
at org.junit.Assert.assertEquals(Assert.java:645)
at org.junit.Assert.assertEquals(Assert.java:631)
at com.bugsnag.android.ErrorStoreAsyncTest.testLaunchThenConnectivity(ErrorStoreAsyncTest.java:90)
at java.lang.reflect.Method.invoke(Native Method)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
Unit test removed as this will be covered by mazerunner instead. |
Pull Request Test Coverage Report for Build 1245
💛 - Coveralls |
@kattrali I have run the 3 new mazerunner scenarios against this and they pass, whereas on master they would fail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed this works in an environment with slow network speeds and high latency.
Build unity project twice to ensure -ObjC flag is set
Adds a semaphore to the
ErrorStore
that is used when flushing cached reports. This prevents a scenario where a report could potentially be sent multiple times.