From 0a954e50661f0fa6fc74ab81809ef7d76c6e1d66 Mon Sep 17 00:00:00 2001 From: Daniel Hiltgen Date: Mon, 6 May 2024 14:15:37 -0700 Subject: [PATCH] Fix stale test logic The model processing was recently changed to be deferred but this test scenario hadn't been adjusted for that change in behavior. --- server/sched_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/server/sched_test.go b/server/sched_test.go index 3e47ed02..7e4faa61 100644 --- a/server/sched_test.go +++ b/server/sched_test.go @@ -352,11 +352,9 @@ func TestGetRunner(t *testing.T) { scenario1c.req.model.ModelPath = "bad path" slog.Info("scenario1c") successCh1c, errCh1c := s.GetRunner(scenario1c.ctx, scenario1c.req.model, scenario1c.req.opts, scenario1c.req.sessionDuration) - require.Len(t, s.pendingReqCh, 0) - require.Len(t, successCh1c, 0) - require.Len(t, errCh1c, 0) - + // Starts in pending channel, then should be quickly processsed to return an error time.Sleep(5 * time.Millisecond) + require.Len(t, successCh1c, 0) s.loadedMu.Lock() require.Len(t, s.loaded, 0) s.loadedMu.Unlock()