From 78110651b29668d338a08abdd36beb975ac86d8c Mon Sep 17 00:00:00 2001 From: Vladislav Zhurba Date: Mon, 16 Dec 2024 10:54:13 -0800 Subject: [PATCH] Fix test_is_done without a sync Event might not have yet completed when a synchronize is skipped --- cuda_core/tests/test_event.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cuda_core/tests/test_event.py b/cuda_core/tests/test_event.py index 0d650b4f..df1a7fc4 100644 --- a/cuda_core/tests/test_event.py +++ b/cuda_core/tests/test_event.py @@ -43,4 +43,6 @@ def test_is_done(init_cuda): options = EventOptions(enable_timing=False) stream = Device().create_stream() event = stream.record(options=options) - assert event.is_done is True + # Without a sync, the captured work might not have yet completed + # Therefore this check should never raise an exception + assert event.is_done in (True, False)