couchdb
couchdb copied to clipboard
Address race in cpse_incref_decref test
Overview
Occasionally, this test fails with the following stack trace:
cpse_gather: make_test_fun (cpse_incref_decref)...*failed*
in function cpse_test_ref_counting:'-cpse_incref_decref/1-fun-0-'/2 (src/cpse_test_ref_counting.erl, line 44)
in call from cpse_test_ref_counting:cpse_incref_decref/1 (src/cpse_test_ref_counting.erl, line 44)
in call from eunit_test:run_testfun/1 (eunit_test.erl, line 71)
in call from eunit_proc:run_test/1 (eunit_proc.erl, line 522)
in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 347)
in call from eunit_proc:handle_test/2 (eunit_proc.erl, line 505)
in call from eunit_proc:tests_inorder/3 (eunit_proc.erl, line 447)
in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 337)
**error:{assert,[{module,cpse_test_ref_counting},
{line,44},
{expression,"lists : member ( Pid , Pids1 )"},
{expected,true},
{value,false}]}
output:<<"">>
Wrap the former assertion in a test_util:wait call to account for
the apparent race between client readiness and
couch_db_engine:monitored_by/1.
Testing recommendations
Related Issues or Pull Requests
Checklist
- [x] Code is written and works correctly
- [x] 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