test(agent): deflake queued voice steering
This commit is contained in:
parent
b2dc430a5e
commit
56fe6ac596
1 changed files with 14 additions and 1 deletions
|
|
@ -935,11 +935,24 @@ func TestAgentLoop_Run_QueuedVoiceMessageIsTranscribedBeforeSteering(t *testing.
|
||||||
|
|
||||||
subCtx, subCancel := context.WithTimeout(context.Background(), 5*time.Second)
|
subCtx, subCancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||||
defer subCancel()
|
defer subCancel()
|
||||||
|
|
||||||
|
var out1 bus.OutboundMessage
|
||||||
select {
|
select {
|
||||||
case <-msgBus.OutboundChan():
|
case out1 = <-msgBus.OutboundChan():
|
||||||
case <-subCtx.Done():
|
case <-subCtx.Done():
|
||||||
t.Fatal("expected outbound response")
|
t.Fatal("expected outbound response")
|
||||||
}
|
}
|
||||||
|
if out1.Content != "continued response" {
|
||||||
|
t.Fatalf("expected continued response, got %q", out1.Content)
|
||||||
|
}
|
||||||
|
|
||||||
|
noExtraCtx, cancelNoExtra := context.WithTimeout(context.Background(), 200*time.Millisecond)
|
||||||
|
defer cancelNoExtra()
|
||||||
|
select {
|
||||||
|
case out2 := <-msgBus.OutboundChan():
|
||||||
|
t.Fatalf("expected stale direct response to be suppressed, got extra outbound %q", out2.Content)
|
||||||
|
case <-noExtraCtx.Done():
|
||||||
|
}
|
||||||
|
|
||||||
cancelRun()
|
cancelRun()
|
||||||
select {
|
select {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue