From 41c14c6306a4c1b125a027653b1640259516b878 Mon Sep 17 00:00:00 2001 From: Theo Kanning Date: Sat, 2 Dec 2023 13:41:34 -0600 Subject: [PATCH] Fix fine-tuning test email notifications (#428) Deleting the file immediately after cancelling the job results in a failed job and a notification email. Adding a short wait fixes this. --- .../com/theokanning/openai/service/FineTuningTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/service/src/test/java/com/theokanning/openai/service/FineTuningTest.java b/service/src/test/java/com/theokanning/openai/service/FineTuningTest.java index 81a8e808..c0b98f6f 100644 --- a/service/src/test/java/com/theokanning/openai/service/FineTuningTest.java +++ b/service/src/test/java/com/theokanning/openai/service/FineTuningTest.java @@ -80,10 +80,13 @@ void retrieveFineTuningJob() { } @Test - @Order(2) - void cancelFineTuningJob() { + @Order(3) + void cancelFineTuningJob() throws Exception { FineTuningJob fineTuningJob = service.cancelFineTuningJob(fineTuningJobId); assertEquals("cancelled", fineTuningJob.getStatus()); + + // wait before cleaning up to prevent job failure emails + TimeUnit.SECONDS.sleep(3); } }