Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed unit tests where SequencePair comparisons fail due to last_active #2446

Merged
merged 2 commits into from Aug 17, 2021

Conversation

matthiashanel
Copy link
Contributor

When testing client changes nats-io/nats.go#794
I noticed these tests fail. Typically one time in a comparison was last.
This makes the error go away, but I'm not sure if setting Last to nil is the right thing to do.
Only merge after the client library got updated in the server.

Signed-off-by: Matthias Hanel mh@synadia.com

=== RUN TestJetStreamClusterConsumerState
jetstream_cluster_test.go:625: Consumer delivered did not match after leader switch, wanted {Consumer:5 Stream:5 Last:2021-08-17 00:23:42.944572 +0000 UTC}, got {Consumer:5 Stream:5 Last:2021-08-17 00:23:42.945467 +0000 UTC}
--- FAIL: TestJetStreamClusterConsumerState (1.82s)

=== RUN TestJetStreamClusterStreamPublishWithActiveConsumers
jetstream_cluster_test.go:1052: Consumer info did not match: &{Stream:foo Name:dlc Created:2021-08-17 00:23:55.560387 +0000 UTC Config:{Durable:dlc DeliverSubject:_INBOX.PMVrox5lIISQNjxPY2pXAV DeliverGroup: DeliverPolicy:0 OptStartSeq:0 OptStartTime: 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 Last:2021-08-17 00:23:56.009337 +0000 UTC} AckFloor:{Consumer:1 Stream:1 Last:2021-08-17 00:23:55.997206 +0000 UTC} NumAckPending:10 NumRedelivered:0 NumWaiting:0 NumPending:0 Cluster: PushBound:true} vs &{Stream:foo Name:dlc Created:2021-08-17 00:23:55.560387 +0000 UTC Config:{Durable:dlc DeliverSubject:_INBOX.PMVrox5lIISQNjxPY2pXAV DeliverGroup: DeliverPolicy:0 OptStartSeq:0 OptStartTime: 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 Last:2021-08-17 00:23:56.00995 +0000 UTC} AckFloor:{Consumer:1 Stream:1 Last:2021-08-17 00:23:55.997597 +0000 UTC} NumAckPending:10 NumRedelivered:0 NumWaiting:0 NumPending:0 Cluster: PushBound:true}
--- FAIL: TestJetStreamClusterStreamPublishWithActiveConsumers (1.55s)

=== RUN TestJetStreamClusterUserSnapshotAndRestore
jetstream_cluster_test.go:2699: Delivered states do not match {Consumer:100 Stream:100 Last:} vs {Consumer:100 Stream:100 Last:2021-08-17 00:24:30.332541 +0000 UTC}
--- FAIL: TestJetStreamClusterUserSnapshotAndRestore (2.47s)

=== RUN TestJetStreamServerEncryption
jetstream_test.go:12063: Consumer infos did not match
&{Stream:TEST Name:dlc Created:2021-08-16 20:28:12.441086 -0400 EDT m=+335.874847871 Config:{Durable:dlc DeliverSubject: DeliverGroup: DeliverPolicy:0 OptStartSeq:0 OptStartTime: AckPolicy:AckExplicit AckWait:30s MaxDeliver:-1 FilterSubject:foo ReplayPolicy:0 RateLimit:0 SampleFrequency: MaxWaiting:512 MaxAckPending:65536 FlowControl:false Heartbeat:0s} Delivered:{Consumer:10 Stream:10 Last:2021-08-17 00:28:12.392064 +0000 UTC} AckFloor:{Consumer:5 Stream:5 Last:2021-08-17 00:28:12.39246 +0000 UTC} NumAckPending:5 NumRedelivered:0 NumWaiting:0 NumPending:0 Cluster: PushBound:false}
vs
&{Stream:TEST Name:dlc Created:2021-08-16 20:28:12.441086 -0400 EDT m=+335.874847871 Config:{Durable:dlc DeliverSubject: DeliverGroup: DeliverPolicy:0 OptStartSeq:0 OptStartTime: AckPolicy:AckExplicit AckWait:30s MaxDeliver:-1 FilterSubject:foo ReplayPolicy:0 RateLimit:0 SampleFrequency: MaxWaiting:512 MaxAckPending:65536 FlowControl:false Heartbeat:0s} Delivered:{Consumer:10 Stream:10 Last:} AckFloor:{Consumer:5 Stream:5 Last:} NumAckPending:5 NumRedelivered:0 NumWaiting:0 NumPending:0 Cluster: PushBound:false}
--- FAIL: TestJetStreamServerEncryption (0.10s)

…_active

Signed-off-by: Matthias Hanel <mh@synadia.com>
Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems there is a problem. Maybe your branch is outdated. There is a vet problem:

vet: server/jetstream_cluster_test.go:624:16: nci.Delivered.Last undefined (type nats.SequencePair has no field or method Last)

Signed-off-by: Matthias Hanel <mh@synadia.com>
@matthiashanel
Copy link
Contributor Author

@kozlovic It did not have the library updated. Since you merged, I updated the client library in go.mod/vendor

Copy link
Member

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matthiashanel matthiashanel merged commit 5d8746e into main Aug 17, 2021
@matthiashanel matthiashanel deleted the sequence-pair-last branch August 17, 2021 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants