Propagate cancellation and preserve resumable state

This commit is contained in:
2026-11-20 05:53:49 +00:00
parent a6c6f1e4ab
commit c7a5ff316d
21 changed files with 356 additions and 27 deletions

View File

@@ -196,3 +196,20 @@ func TestSessionAcquisitionPreservesRemoteFailureCause(t *testing.T) {
t.Fatal(err)
}
}
func TestConfigurationAcquisitionStopsAfterSynchronousCancellation(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
loadErr := errors.New("native configuration load failed")
acquired := newConfigurationAcquisition(configurationSelection{Config: suppliedSelection("synthetic.yaml")}, commandDependencies{loadPipelineConfig: func(string, config.PipelineLoadOptions) (*config.PipelineConfig, error) {
cancel()
return nil, loadErr
}})
_, err := acquired.Pipeline(ctx)
if !errors.Is(err, context.Canceled) || !errors.Is(err, loadErr) || operationOutcome(err).Status != 1 {
t.Fatalf("lost canceled native load causes: %v", err)
}
if acquired.pipeline != nil {
t.Fatal("cached a canceled native load")
}
}