From 5b3c35db350477c1461993c08b276e88af8be2a5 Mon Sep 17 00:00:00 2001 From: Allan Tatter Date: Thu, 4 Jul 2024 11:19:06 +0300 Subject: [PATCH] Fix test keeping stuck --- tests/Unit/ThreadsTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/Unit/ThreadsTest.php b/tests/Unit/ThreadsTest.php index b95e01d..018ba78 100644 --- a/tests/Unit/ThreadsTest.php +++ b/tests/Unit/ThreadsTest.php @@ -50,6 +50,9 @@ public function test_threads(): void while ($status !== 'completed') { $runStatus = OpenAI::threads()->run()->retrieve($thread->id, $run->id); $this->assertTrue($runStatus instanceof RunResponse); + if ($runStatus->status === 'completed') { + $status = 'completed'; + } sleep(1); }