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 mem3 tests #1285

Merged
merged 3 commits into from
Apr 17, 2018
Merged

Fix mem3 tests #1285

merged 3 commits into from
Apr 17, 2018

Conversation

eiri
Copy link
Member

@eiri eiri commented Apr 17, 2018

Overview

After fix of fake_db function mem3_shards stopped silently failing and exposed race condition in
mem3_shards_changes_test_ test. What was going on, the changes listener started in the test's setup was crashing when tried to register on unstarted couch_event server, so the test was either fast enough to do assertions before of that or failed on a dead listener process.

This fix removing dependency on mocking all modules involved and just uses standard test_util's start and stop couch. Module's start moved into the test body to avoid masking a potential failure in setup.

Also the tests mem3_sync_security_test and mem3_util_test been modified to avoid setup and teardown side effects.

Testing recommendations

Minimal run make eunit apps=mem3 suites=mem3_sync_security_test,mem3_util_test,mem3_shards should pass, along with complete mem3 test suite test.

Related Issues or Pull Requests

Closes #1282

Checklist

  • Code is written and works correctly;
  • Changes are covered by tests;
  • Documentation reflects the changes;

The changes listener started in setup was crashing when tried to
register on unstarted couch_event server, so the test was either
fast enough to do assertions before of that or failed on dead
listener process.

This change removing dep on mocking all modules involved and just
uses standard test_util's star and stop couch. Module start moved
into the test bodyt to avoid masking potential failure in setup.
Copy link
Contributor

@nickva nickva left a comment

Choose a reason for hiding this comment

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

Very nice!

@eiri eiri merged commit 8de46c7 into apache:master Apr 17, 2018
@eiri eiri deleted the fix-mem3-tests branch April 17, 2018 17:04
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.

Test suite mem3_shards occasionally failing.
2 participants