Complete step 3 of the migration plan and clean up the implemented roadmap

This commit is contained in:
2026-07-27 19:05:28 -05:00
parent 8703793b0c
commit 3074b3165a
3 changed files with 19 additions and 521 deletions

View File

@@ -610,6 +610,8 @@ func TestRunPassesPreparedRequestToInjectedLLMClient(t *testing.T) {
}
func TestEngineRunPropagatesCallerCancellation(t *testing.T) {
const synchronizationTimeout = 5 * time.Second
started := make(chan struct{})
transport := roundTripFunc(func(req *http.Request) (*http.Response, error) {
close(started)
@@ -640,10 +642,24 @@ func TestEngineRunPropagatesCallerCancellation(t *testing.T) {
result <- err
}()
<-started
watchdog := time.NewTimer(synchronizationTimeout)
defer watchdog.Stop()
select {
case <-started:
case err := <-result:
t.Fatalf("Engine.Run returned before the transport started: %v", err)
case <-watchdog.C:
t.Fatal("timed out waiting for the transport to start")
}
cancel()
if err := <-result; !errors.Is(err, scriptorium.ErrLLMGenerate) {
t.Fatalf("expected ErrLLMGenerate after caller cancellation, got %v", err)
select {
case err := <-result:
if !errors.Is(err, scriptorium.ErrLLMGenerate) {
t.Fatalf("expected ErrLLMGenerate after caller cancellation, got %v", err)
}
case <-watchdog.C:
t.Fatal("timed out waiting for Engine.Run to return after cancellation")
}
}