mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Daemonize thread to make sure test exits
This commit is contained in:
parent
1d073ee706
commit
7097efaa33
@ -72,7 +72,7 @@ def test_changefeed_reconnects_when_connection_lost(monkeypatch):
|
|||||||
# initialize ChangeFeed and put it in a thread
|
# initialize ChangeFeed and put it in a thread
|
||||||
changefeed = ChangeFeed('cat_facts', ChangeFeed.INSERT)
|
changefeed = ChangeFeed('cat_facts', ChangeFeed.INSERT)
|
||||||
changefeed.outqueue = mp.Queue()
|
changefeed.outqueue = mp.Queue()
|
||||||
t_changefeed = Thread(target=changefeed.run_forever)
|
t_changefeed = Thread(target=changefeed.run_forever, daemon=True)
|
||||||
|
|
||||||
t_changefeed.start()
|
t_changefeed.start()
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
@ -104,3 +104,7 @@ def test_changefeed_reconnects_when_connection_lost(monkeypatch):
|
|||||||
|
|
||||||
fact = changefeed.outqueue.get()['fact']
|
fact = changefeed.outqueue.get()['fact']
|
||||||
assert fact == 'Cats sleep 70% of their lives.'
|
assert fact == 'Cats sleep 70% of their lives.'
|
||||||
|
|
||||||
|
# stop the DB process
|
||||||
|
proc.terminate()
|
||||||
|
proc.wait()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user