-
Notifications
You must be signed in to change notification settings - Fork 782
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
Flaky ENT Tests fix #1886
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,19 +139,14 @@ func TestMain(m *testing.M) { | |
|
||
func (c *ClientSet) createConsulTestResources() error { | ||
catalog := testClients.Consul().Catalog() | ||
|
||
node, err := testClients.Consul().Agent().NodeName() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
for _, tenancy := range tenancyHelper.TestTenancies() { | ||
partition := "" | ||
namespace := "" | ||
if tenancyHelper.IsConsulEnterprise() { | ||
partition = tenancy.Partition | ||
namespace = tenancy.Namespace | ||
} | ||
node := "node" + tenancy.Partition | ||
// service with meta data | ||
serviceMetaService := &api.AgentService{ | ||
ID: fmt.Sprintf("service-meta-%s-%s", tenancy.Partition, tenancy.Namespace), | ||
|
@@ -241,6 +236,7 @@ func (c *ClientSet) createConsulTestResources() error { | |
if err := testClients.createConsulPeerings(tenancy); err != nil { | ||
return err | ||
} | ||
time.Sleep(200 * time.Millisecond) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this needed? The creation of resources should be in sync right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is to make sure that consul reaches a state of entropy. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
} | ||
|
||
return nil | ||
|
@@ -562,7 +558,6 @@ func (c *ClientSet) createConsulPartitions() error { | |
|
||
return nil | ||
} | ||
|
||
func (c *ClientSet) createConsulNs() error { | ||
for _, tenancy := range tenancyHelper.TestTenancies() { | ||
if tenancy.Namespace != "" && tenancy.Namespace != "default" { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this change needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, segregated the default cases for CE. |
||
}, | ||
{ | ||
Path: "test-kv-list/prefix/wave/ocean", | ||
Key: "wave/ocean", | ||
Value: fmt.Sprintf("sleek-%s-%s", tenancy.Partition, tenancy.Namespace), | ||
Value: "sleek-default-default", | ||
}, | ||
{ | ||
Path: "test-kv-list/prefix/zip", | ||
Key: "zip", | ||
Value: fmt.Sprintf("zap-%s-%s", tenancy.Partition, tenancy.Namespace), | ||
Value: "zap-default-default", | ||
}, | ||
}, | ||
}, | ||
|
@@ -320,17 +320,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", | ||
}, | ||
{ | ||
Path: "test-kv-list/prefix/wave/ocean", | ||
Key: "wave/ocean", | ||
Value: fmt.Sprintf("sleek-%s-%s", tenancy.Partition, tenancy.Namespace), | ||
Value: "sleek-default-default", | ||
}, | ||
{ | ||
Path: "test-kv-list/prefix/zip", | ||
Key: "zip", | ||
Value: fmt.Sprintf("zap-%s-%s", tenancy.Partition, tenancy.Namespace), | ||
Value: "zap-default-default", | ||
}, | ||
}, | ||
}, | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.