浏览代码

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.
Daniel Hiltgen 1 年之前
父节点
当前提交
0a954e5066
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      server/sched_test.go

+ 2 - 4
server/sched_test.go

@@ -352,11 +352,9 @@ func TestGetRunner(t *testing.T) {
 	scenario1c.req.model.ModelPath = "bad path"
 	scenario1c.req.model.ModelPath = "bad path"
 	slog.Info("scenario1c")
 	slog.Info("scenario1c")
 	successCh1c, errCh1c := s.GetRunner(scenario1c.ctx, scenario1c.req.model, scenario1c.req.opts, scenario1c.req.sessionDuration)
 	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)
 	time.Sleep(5 * time.Millisecond)
+	require.Len(t, successCh1c, 0)
 	s.loadedMu.Lock()
 	s.loadedMu.Lock()
 	require.Len(t, s.loaded, 0)
 	require.Len(t, s.loaded, 0)
 	s.loadedMu.Unlock()
 	s.loadedMu.Unlock()