Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

Fix flaky replicator tests. #32

Merged
merged 1 commit into from
Mar 11, 2016

Conversation

nickva
Copy link
Contributor

@nickva nickva commented Mar 9, 2016

Replication+compaction test periodically times out
when running under CI. Adjust writer timeout from 3 to 9 sec.

Also clean up confusing / unused TIMEOUT_STOP constant.

Replication+compaction test periodically times out
when running under CI. Adjust writer timeout from 3 to 9 sec.

Also clean up confusing / unused TIMEOUT_STOP constant.
@kxepal
Copy link
Member

kxepal commented Mar 9, 2016

With the stone in my heart +1.
We should revert this and apply special timeout policy for Travis and else slow CI, but that's all later.

@asfgit asfgit merged commit b26c6f0 into apache:master Mar 11, 2016
asfgit pushed a commit that referenced this pull request Mar 11, 2016
This closes #32

Signed-off-by: Eric Avdey <eiri@eiri.ca>
@nickva nickva deleted the fix-flaky-replicator-tests branch March 11, 2016 21:07
asfgit pushed a commit that referenced this pull request Mar 14, 2017
* Fix `not_purged` error in module load test.

Depending on the order of how tests runs (or because of using mock), some of
the tested modules re already loaded before `load_file` line is reached, and so
it crashes with `not_purged` error:

```
**error:{assertMatch,[{module,couch_replicator_modules_load_tests},
              {line,45},
              {expression,"code : load_file ( Mod )"},
              {pattern,"{ module , _ }"},
              {value,{error,not_purged}}]}
  output:<<"">>
```

That happens because load_file does not auto-purge old entries.

Switch to use ensure_loaded, since we only care that modules can
be loaded.

* Disable coverage report for now.

There seems to be a bug with how it interacts with either
rebar's eunit or meck.

It results in errors like these on Erlang 18.3

```
*** context setup failed ***
**in function meck_proc:set_expect/2 (src/meck_proc.erl, line 113)
in call from meck:expect/4 (src/meck.erl, line 245)
in call from couch_replicator_doc_processor:setup/0 (src/couch_replicator_doc_processor.erl, line 288)
**error:{case_clause,
    {error,
        {compile_forms,
            {error,
                [{"cover.erl",
                  [{77,erl_lint,{undefined_function,{compile_beam,2}}}]}],
                []}}}}
```

* Moved some functions to scheduler and added tests to doc processor

`rep_state/1`, `find_jobs_by_dbname/1`, `find_jobs_by_doc/2`

These belong there as they access internal ets fields. They were spread
around other modules while scheduler was being worked on (to avoid
generating conflicts).

Added tests to couch_replicator_doc_processor.

During tests noticed duplicate docs were still updated with `replication_id`,
even after we stopped doing that during triggering. Disabled that and cleaned up
functions used for it.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants