Tool runner bus: pulled workers belong to their connection; two tests wait for what they assert
A worker bound for a pull was kept for the process, so a later connection's pull used a worker bound on a closed connection and answered "connection closed" (every run of TestAHolderPullsOneMessageWhenItHasRoom after the first). The bound workers and the pulled messages are now the Conn's. The two tests that failed main.165 and main.115 asserted on bus figures before the bus had delivered them: the worker's pending count right after a publish, a no-wait pull right after a publish, a callback counter read when a flush returned, a 300 ms delay and a 2 s ack wait a loaded machine overruns. They now count binds on a channel the watcher's reader fills, pull with a wait that ends at the delivery, prove "nothing fetched ahead" by the second message's first delivery, and use bounds a loaded machine stays within. Builds: design 47 H H-A-363 (fix-a-bug-met-twice; whole-module tests under load, H-A-327)
This commit is contained in:
@@ -34,11 +34,13 @@ func seatMesh(t *testing.T) (*mt.Mesh, *bus.Conn, nats.JetStreamContext) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
// The workers' acknowledgement wait is wider than a test spends holding a message on a loaded machine: a message
|
||||
// held past it is delivered again, and a pull that wants none would get it (design 47 H, H-A-363).
|
||||
for stream, c := range map[string]*nats.ConsumerConfig{
|
||||
"SEAT_OPERATOR_CHANNEL": {Durable: "SEAT_OPERATOR_CHANNEL_worker", AckPolicy: nats.AckExplicitPolicy,
|
||||
FilterSubject: "mesh.seat.operator-channel.accept.>", AckWait: 2 * time.Second},
|
||||
FilterSubject: "mesh.seat.operator-channel.accept.>", AckWait: 30 * time.Second},
|
||||
"SEAT_CHANNEL": {Durable: "SEAT_CHANNEL_TELEGRAM_worker", AckPolicy: nats.AckExplicitPolicy,
|
||||
FilterSubject: "mesh.seat.channel.accept.*.telegram", AckWait: 2 * time.Second},
|
||||
FilterSubject: "mesh.seat.channel.accept.*.telegram", AckWait: 30 * time.Second},
|
||||
} {
|
||||
if _, err := js.AddConsumer(stream, c); err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user