Skip to content

Speedup test suite#2376

Closed
davisp wants to merge 14 commits intomasterfrom
speedup-test-suite
Closed

Speedup test suite#2376
davisp wants to merge 14 commits intomasterfrom
speedup-test-suite

Conversation

@davisp
Copy link
Copy Markdown
Member

@davisp davisp commented Dec 19, 2019

Overview

Make tests faster

Testing recommendations

time make check

Checklist

  • Code is written and works correctly
  • Changes are covered by tests
  • Any new configurable parameters are documented in rel/overlay/etc/default.ini
  • A PR for documentation changes has been made in https://github.com/apache/couchdb-documentation

@davisp davisp force-pushed the speedup-test-suite branch 2 times, most recently from 5c85c3e to aae193f Compare December 19, 2019 22:22
We sleep for a bit more than a second for each test. Rather than using
return to skip a test we just mark the test as skipped so we don't
have to waste time. This saves about 25s on the test suite.
The body of these tests were running during the setup phase which is not
correct. Wrapping each body with `?_test()` macros fixes the issue.
The quiet and start periods of a second were costing quite a bit of
time. Setting them to zero shaves off about 26 seconds.
This moves all of the mock work to a single setup function and then just
resets all of the mocked modules before each test run.
Moving the meck configuration into setup and resetting in foreach makes
tests quite a bit faster.
This just populates a single test db and then copies the raw file to a
new database name for each individual test.
Another module where loading the meck expect values once per suite saves
us 20s or so.
Another example of moving mocks to a setup and using `meck:reset/1` in
the foreach fixture.
Another example of moving mocks around.
There's no need to call through mocked functions when we can just assert
its the correct function returned.
Increase the doc write batch count in the background writer process to
speed up the should_populate_and_compact test.
@davisp davisp force-pushed the speedup-test-suite branch from aae193f to c7712ce Compare December 20, 2019 15:18
@davisp davisp closed this Dec 25, 2019
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.

1 participant