Skip to content

CI: TestEndpointAddNoLabels: metrics assertion failed #11955

@aanm

Description

@aanm
FAIL: <autogenerated>:1: DaemonEtcdSuite.TestEndpointAddNoLabels
endpoint_test.go:150:
    c.Errorf("Metrics assertion failed on line %d for Endpoint state %s: obtained %d, expected %d",
        line, state, obtained, expected)
... Error: Metrics assertion failed on line 104 for Endpoint state waiting-to-regenerate: obtained 0, expected 1
	// Create the endpoint without any labels.
	epTemplate := getEPTemplate(c, ds.d)
	_, _, err := ds.d.createEndpoint(context.TODO(), epTemplate)
	c.Assert(err, IsNil)

	// Endpoint enters WaitingToRegenerate as it has its labels updated during
	// creation.
->	assertOnMetric(c, string(models.EndpointStateWaitingToRegenerate), 1)

@christarazi createEndpoint will regenerate the endpoint in the background so line 104 might fail depending on the machine load. I would suggest to add a function that waits until the metric with that particular value similar to:

// Wait until lock1 is gotten.
c.Assert(testutils.WaitUntil(func() bool {
select {
case <-gotLock1:
return true
default:
return false
}
}, 5*time.Second), IsNil)

Metadata

Metadata

Assignees

Labels

area/CIContinuous Integration testing issue or flakeci/flakeThis is a known failure that occurs in the tree. Please investigate me!kind/bug/CIThis is a bug in the testing code.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions