Files
ITWorx Pulse release export bd774932d5
Public source validation / validate (push) Failing after 3m8s
Publish ITWorx Pulse source
2026-09-03 02:09:19 +02:00

16 lines
528 B
Go

package live
import "testing"
func TestSampleOutputQueueDropsWhenFull(t *testing.T) {
session := &session{outbound: make(chan []byte, 1)}
session.outbound <- []byte("queued")
message := SamplesMessage{SchemaVersion: 1, Type: "samples", SubscriptionID: "sub", Sequence: 1, Samples: []Sample{}}
if err := session.send(message); err != nil {
t.Fatalf("sample drop should preserve session health: %v", err)
}
if len(session.outbound) != 1 {
t.Fatalf("queue length=%d, want bounded length 1", len(session.outbound))
}
}