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

Remove unnecessary rmq database operations in unit tests. #4236

Merged
merged 21 commits into from
Nov 7, 2019

Conversation

charlotteliang
Copy link
Contributor

@charlotteliang charlotteliang commented Nov 5, 2019

DB operations between different test class that access the same database sometimes cause race conditions. Minimize DB initialization and operations to see if this resolves the issue.

@maksymmalyhin
Copy link
Contributor

Copy link
Contributor

@maksymmalyhin maksymmalyhin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking care of it!

Example/Messaging/Tests/FIRInstanceIDWithFCMTest.m Outdated Show resolved Hide resolved
_testUtil = [[FIRMessagingTestUtilities alloc] initWithUserDefaults:defaults withRMQManager:YES];
_mockMessaging = _testUtil.mockMessaging;
_mockInstanceID = _testUtil.mockInstanceID;
_messaging = _testUtil.messaging;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just remove _mockMessaging, _mockInstanceID, etc. and refer to _testUtil directly to avoid potential confusion in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this gonna be a big refactor, will probably do it in another CL.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done in this PR.

@charlotteliang
Copy link
Contributor Author

xcode 10.2 seems to start failing but with some unrelated errors

Copy link
Member

@paulb777 paulb777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Please update .travis.yml to make the tests required again. see here.

Working on the Xcode 10.2 issue in #4254

@charlotteliang
Copy link
Contributor Author

Failure is unrelated to Messaging. Also couldn't find the restart the test button anymore. I just submit the code for now.

@charlotteliang charlotteliang merged commit 54b1458 into master Nov 7, 2019
@charlotteliang charlotteliang deleted the fcm-master-break branch November 7, 2019 04:11
@firebase firebase locked and limited conversation to collaborators Dec 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.