fix: keep cancellation pending until execution cleanup is confirmed
This commit is contained in:
@@ -135,7 +135,12 @@ func TestHandlerWiresRunTitleGenerator(t *testing.T) {
|
||||
}
|
||||
defer store.Close()
|
||||
configured := HandlerWithOptions(ctx, Options{RunTitles: summarise.GenerateTitle}, store).(*runHandler)
|
||||
bare := HandlerWithOptions(ctx, Options{}, store).(*runHandler)
|
||||
bareStore, err := pipeline.Open(filepath.Join(t.TempDir(), "bare.db"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer bareStore.Close()
|
||||
bare := HandlerWithOptions(ctx, Options{}, bareStore).(*runHandler)
|
||||
defer func() { cancel(); WaitRuns(configured); WaitRuns(bare) }()
|
||||
if configured.runner.title == nil {
|
||||
t.Fatal("configured RunTitles was not applied to the runner")
|
||||
@@ -461,7 +466,12 @@ func TestHandlerWiresStepVerdictGenerator(t *testing.T) {
|
||||
}
|
||||
defer store.Close()
|
||||
configured := HandlerWithOptions(ctx, Options{StepVerdicts: summarise.GenerateVerdictReason}, store).(*runHandler)
|
||||
bare := HandlerWithOptions(ctx, Options{}, store).(*runHandler)
|
||||
bareStore, err := pipeline.Open(filepath.Join(t.TempDir(), "bare.db"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer bareStore.Close()
|
||||
bare := HandlerWithOptions(ctx, Options{}, bareStore).(*runHandler)
|
||||
defer func() { cancel(); WaitRuns(configured); WaitRuns(bare) }()
|
||||
if configured.runner.verdict == nil {
|
||||
t.Fatal("configured StepVerdicts was not applied to the runner")
|
||||
|
||||
Reference in New Issue
Block a user