From 69a2d4ccffa7532680bed245fad77bb166ec0bb9 Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Fri, 19 Jul 2024 19:11:25 -0700 Subject: [PATCH] Fix generate test flakyness (#5804) --- server/routes_generate_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/routes_generate_test.go b/server/routes_generate_test.go index c914b3006..5c0caff1c 100644 --- a/server/routes_generate_test.go +++ b/server/routes_generate_test.go @@ -73,8 +73,8 @@ func TestGenerateChat(t *testing.T) { getCpuFn: gpu.GetCPUInfo, reschedDelay: 250 * time.Millisecond, loadFn: func(req *LlmRequest, ggml *llm.GGML, gpus gpu.GpuInfoList, numParallel int) { - // add 10ms delay to simulate loading - time.Sleep(10 * time.Millisecond) + // add small delay to simulate loading + time.Sleep(time.Millisecond) req.successCh <- &runnerRef{ llama: &mock, } @@ -371,6 +371,8 @@ func TestGenerate(t *testing.T) { getCpuFn: gpu.GetCPUInfo, reschedDelay: 250 * time.Millisecond, loadFn: func(req *LlmRequest, ggml *llm.GGML, gpus gpu.GpuInfoList, numParallel int) { + // add small delay to simulate loading + time.Sleep(time.Millisecond) req.successCh <- &runnerRef{ llama: &mock, }