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

Test: expected a fully formed cluster error #6364

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

MauriceVanVeen
Copy link
Member

Cluster tests would sometimes fail with the following error message:

jetstream_helpers_test.go:774: Expected a fully formed cluster, only 0 of 3 peers seen

This was due to a logic error in the tests, where it was assumed that once a meta leader is chosen it will remain the same. That's not always true as the meta leader can still shift around. So, keep fetching the latest leader and check the peers on that.

Previously it would fail by selecting a meta leader, the meta leader would change, and the follower would then be used to request peers on. But because of the following lines in JetStreamClusterPeers():

	cc := js.cluster
	if !cc.isLeader() || cc.meta == nil {
		return nil
	}

You'd get no peers at all, leading into that error message.

Signed-off-by: Maurice van Veen [email protected]

@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner January 10, 2025 16:45
Copy link
Member

@wallyqs wallyqs 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

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

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

LGTM

@derekcollison derekcollison merged commit 1515a6f into main Jan 10, 2025
5 checks passed
@derekcollison derekcollison deleted the maurice/fully-formed-cluster branch January 10, 2025 22:21
neilalexander added a commit that referenced this pull request Jan 13, 2025
Includes the following:

- #6361
- #6362
- #6364
- #6367

Signed-off-by: Neil Twigg <[email protected]>
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.

4 participants