mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
tests: fix occasional timing issue in future test
This commit is contained in:
parent
5fe294a467
commit
ec06d3f4f8
@ -48,10 +48,9 @@ def test_future_wait():
|
|||||||
fut.set_result(None)
|
fut.set_result(None)
|
||||||
|
|
||||||
thread = threading.Thread(target=thread_main)
|
thread = threading.Thread(target=thread_main)
|
||||||
thread.start()
|
|
||||||
|
|
||||||
# Make sure it didn't sneakily already run the thread
|
|
||||||
assert not fut.done()
|
assert not fut.done()
|
||||||
|
thread.start()
|
||||||
|
|
||||||
assert fut.result() is None
|
assert fut.result() is None
|
||||||
|
|
||||||
@ -69,10 +68,9 @@ def test_future_wait_cancel():
|
|||||||
fut.cancel()
|
fut.cancel()
|
||||||
|
|
||||||
thread = threading.Thread(target=thread_main)
|
thread = threading.Thread(target=thread_main)
|
||||||
thread.start()
|
|
||||||
|
|
||||||
# Make sure it didn't sneakily already run the thread
|
|
||||||
assert not fut.done()
|
assert not fut.done()
|
||||||
|
thread.start()
|
||||||
|
|
||||||
with pytest.raises(CancelledError):
|
with pytest.raises(CancelledError):
|
||||||
fut.result()
|
fut.result()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user