fix: replace ConsumeInbound with InboundChan select in client test
MessageBus does not expose a ConsumeInbound method. Use a select on InboundChan() with context cancellation, matching the pattern used in the bus package tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7733c05095
commit
9be27c75a2
1 changed files with 6 additions and 5 deletions
|
|
@ -189,13 +189,14 @@ func TestClientChannel_ReceivesServerMessage(t *testing.T) {
|
|||
|
||||
// The echoed message.create is processed by handleServerMessage which
|
||||
// calls HandleMessage → PublishInbound. Consume it from the bus.
|
||||
msg, ok := mb.ConsumeInbound(ctx)
|
||||
if !ok {
|
||||
select {
|
||||
case msg := <-mb.InboundChan():
|
||||
if msg.Content != "ping" {
|
||||
t.Fatalf("received = %q, want %q", msg.Content, "ping")
|
||||
}
|
||||
case <-ctx.Done():
|
||||
t.Fatal("timed out waiting for echoed message")
|
||||
}
|
||||
if msg.Content != "ping" {
|
||||
t.Fatalf("received = %q, want %q", msg.Content, "ping")
|
||||
}
|
||||
}
|
||||
|
||||
func TestClientChannel_StartTyping(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue