diff options
author | Jay Doane <jaydoane@apache.org> | 2021-10-11 21:28:25 -0700 |
---|---|---|
committer | Jay Doane <jaydoane@apache.org> | 2021-10-11 21:28:25 -0700 |
commit | 37f050f765ed58037dfbfcf0916cfa9333f87210 (patch) | |
tree | 590cf4a0999d599f248e15d7133d602833e8fbba | |
parent | 85f2e183ec47b3f3a409e19ed5c75ae07b4508e1 (diff) | |
download | couchdb-eliminate-compiler-warnings.tar.gz |
Wait until Pid is not aliveeliminate-compiler-warnings
Prevent this race condition:
*** context setup failed ***
**in function couch_replicator_doc_processor:setup/0 (src/couch_replicator_doc_processor.erl, line 872)
**error:{badmatch,{error,{already_started,<0.4946.0>}}}
-rw-r--r-- | src/couch_replicator/src/couch_replicator_doc_processor.erl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/couch_replicator/src/couch_replicator_doc_processor.erl b/src/couch_replicator/src/couch_replicator_doc_processor.erl index 6778d537d..7334a69a6 100644 --- a/src/couch_replicator/src/couch_replicator_doc_processor.erl +++ b/src/couch_replicator/src/couch_replicator_doc_processor.erl @@ -875,7 +875,17 @@ setup() -> teardown(Pid) -> - exit(Pid, kill). + exit(Pid, kill), + test_util:wait( + fun() -> + case is_process_alive(Pid) of + false -> ok; + true -> wait + end + end, + 100, + 5 + ). removed_state_fields() -> |