File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -301,6 +301,10 @@ TEST_F(SchedulerTest, HostTaskCleanup) {
301
301
302
302
Lock.unlock ();
303
303
Event.wait ();
304
+ // The command should be sent to graph cleanup as part of the task
305
+ // submitted to the thread pool, shortly after the event is marked
306
+ // as complete.
307
+ detail::GlobalHandler::instance ().drainThreadPool ();
304
308
ASSERT_EQ (EventImpl->getCommand (), nullptr );
305
309
}
306
310
@@ -345,6 +349,9 @@ TEST_F(SchedulerTest, StreamBufferDeallocation) {
345
349
// The buffers should have been released with graph cleanup once the work is
346
350
// finished.
347
351
EventImplPtr->wait (EventImplPtr);
352
+ // Drain the thread pool to ensure that the cleanup is able to acquire
353
+ // the graph lock.
354
+ detail::GlobalHandler::instance ().drainThreadPool ();
348
355
MSPtr->cleanupCommands ({});
349
356
ASSERT_EQ (MSPtr->MDeferredMemObjRelease .size (), 0u );
350
357
}
You can’t perform that action at this time.
0 commit comments