nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
15.97k stars 1.41k forks source link

Test failed: TestJetStreamClusterStreamPublishWithActiveConsumers #2198

Closed timmyyuan closed 1 year ago

timmyyuan commented 3 years ago

Defect

Versions of nats-server and affected client libraries used:

nats-server v2.2.3

OS/Container environment:

$ uname -a
Linux vultr.guest 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Steps or code to reproduce the issue:

Checkout nats-server v2.2.3, run

go test -i ./... && go test -v -race -p=1 --failfast ./...

Expected result:

The test will pass

Actual result:

2021-05-10T04:17:02.0739247Z === RUN   TestJetStreamClusterStreamPublishWithActiveConsumers
2021-05-10T04:17:03.7456926Z     jetstream_cluster_test.go:1040: Consumer info did not match: &{Stream:foo Name:dlc Created:2021-05-10 04:17:02.837001045 +0000 UTC Config:{Durable:dlc DeliverSubject:_INBOX.43SQpeZjllavtdIlWBdpp1 DeliverPolicy:0 OptStartSeq:0 OptStartTime:<nil> AckPolicy:AckExplicit AckWait:30s MaxDeliver:-1 FilterSubject:foo ReplayPolicy:0 RateLimit:0 SampleFrequency: MaxWaiting:0 MaxAckPending:65536 FlowControl:false Heartbeat:0s} Delivered:{Consumer:11 Stream:11} AckFloor:{Consumer:1 Stream:1} NumAckPending:10 NumRedelivered:0 NumWaiting:0 NumPending:1 Cluster:<nil>} vs &{Stream:foo Name:dlc Created:2021-05-10 04:17:02.837001045 +0000 UTC Config:{Durable:dlc DeliverSubject:_INBOX.43SQpeZjllavtdIlWBdpp1 DeliverPolicy:0 OptStartSeq:0 OptStartTime:<nil> AckPolicy:AckExplicit AckWait:30s MaxDeliver:-1 FilterSubject:foo ReplayPolicy:0 RateLimit:0 SampleFrequency: MaxWaiting:0 MaxAckPending:65536 FlowControl:false Heartbeat:0s} Delivered:{Consumer:11 Stream:11} AckFloor:{Consumer:1 Stream:1} NumAckPending:10 NumRedelivered:0 NumWaiting:0 NumPending:0 Cluster:<nil>}
2021-05-10T04:17:03.7769816Z --- FAIL: TestJetStreamClusterStreamPublishWithActiveConsumers (1.70s)
ripienaar commented 3 years ago

We have some flappers due to timing, load of the tester etc, over time they improve.

Are you finding this one always fail? it passes for me.

timmyyuan commented 3 years ago

No, it's a flaky test. You can reproduce it by

go test -v -race -p=1 --failfast github.com/nats-io/nats-server/v2/server -run TestJetStreamClusterStreamPublishWithActiveConsumers -count 100