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

Flaky ENT Tests fix #1886

Merged
merged 3 commits into from
Feb 26, 2024
Merged

Flaky ENT Tests fix #1886

merged 3 commits into from
Feb 26, 2024

Conversation

kkavish
Copy link
Contributor

@kkavish kkavish commented Feb 23, 2024

  • fixing flaky tests, yay!
  • test using CI and local runs, you need to have an ENT build in path and a valid license set as environment variable.

@kkavish kkavish added the consul-india Consul India team gets notified about the PRs label Feb 23, 2024
@kkavish kkavish requested a review from a team as a code owner February 23, 2024 16:41
Copy link
Collaborator

@tauhid621 tauhid621 left a comment

Choose a reason for hiding this comment

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

Left minor comments

@@ -299,17 +299,17 @@ func TestKVListQuery_Fetch(t *testing.T) {
{
Path: "test-kv-list/prefix/foo",
Key: "foo",
Value: fmt.Sprintf("bar-%s-%s", tenancy.Partition, tenancy.Namespace),
Value: "bar-default-default",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this change needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, segregated the default cases for CE.
but the resource creation is common and uses tenancy name.

Address: testConsul.Config.Bind,
Datacenter: "dc1",
TaggedAddresses: map[string]string{
//"lan": "127.0.0.1",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this is commented. I feel that we should remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we could, but I want to keep it to investigate why it's not working intermittently.

@@ -241,6 +236,7 @@ func (c *ClientSet) createConsulTestResources() error {
if err := testClients.createConsulPeerings(tenancy); err != nil {
return err
}
time.Sleep(200 * time.Millisecond)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this needed? The creation of resources should be in sync right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is to make sure that consul reaches a state of entropy.
the falky tests were due to wrong way of creating resource but the consul servers were not reaching a state of entropy and thus were not evicting the resources sometimes.

Copy link
Member

Choose a reason for hiding this comment

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

If you changed all the registrations so they're not to the local agent but to a fake node then agent entropy won't matter so there should be no need for this sleep

Copy link
Contributor Author

Choose a reason for hiding this comment

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

noted, I had it in place so that if someone accidentally writes to the local agent, the tests would keep on failing, without getting successful intermittently.

What do you suggest?

@kkavish kkavish merged commit 18e415b into main Feb 26, 2024
54 checks passed
@kkavish kkavish deleted the flaky-test-fix branch February 26, 2024 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consul-india Consul India team gets notified about the PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants