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

Fix flaky unit test failures in "Offline mode: disabled by default" #277

Merged
merged 1 commit into from
Jun 14, 2017

Conversation

OsvaldoRosado
Copy link
Member

Addresses #273

This test spuriously failed very frequently due to a race condition with the code to get AppId in CorrelationIdManager. Root cause is the way these tests mock out https.request. The AppId call registers an error handler with the mocked request, which immediately calls the registered fail handler, which will sometimes be the test case's callback. This causes the callback to be called multiple times.

The fix here is to stub out the logic that queries for correlation id during the offline mode E2E tests that do this broken mocking of https.request. A full fix later that allows the AppId logic to remain without mocking would be to use more complicated stubs (like the one seen in EndToEnd/Basic Usage)

@OsvaldoRosado OsvaldoRosado changed the title Fix flaky unit test failures in Offline mode: disabled by default Fix flaky unit test failures in "Offline mode: disabled by default" Jun 14, 2017
@OsvaldoRosado OsvaldoRosado merged commit 9c366e5 into develop Jun 14, 2017
@OsvaldoRosado OsvaldoRosado deleted the osrosado/fixtest branch June 14, 2017 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants