Skip to content

cmd/scheduler unit tests are flaky #6441

Open
@zclyne

Description

@zclyne

Which jobs are flaking:

cmd/scheduler/app

Which test(s) are flaking:

TestServeHealthzAndMetrics

Reason for failure:

E0611 19:08:35.345640   77644 scheduler.go:284] Failed to serve healthz on 127.0.0.1:8082: listen tcp 127.0.0.1:8082: bind: address already in use
E0611 19:08:35.345723   77644 scheduler.go:284] Failed to serve metrics on 127.0.0.1:8083: listen tcp 127.0.0.1:8083: bind: address already in use

Anything else we need to know:

As the unit tests of both the cmd/scheduler and cmd/descheduler are using port 8082 and 8083, they seem to be affecting each other in some scenarios.

Scheduler:

healthAddress := "127.0.0.1:8082"
metricsAddress := "127.0.0.1:8083"

Descheduler:
healthAddress := "127.0.0.1:8082"
metricsAddress := "127.0.0.1:8083"

In fact, after I changed either of them to be 8084 and 8085, unit tests are passing in my environment. I don't have a certain way to reproduce this issue as the unit tests are currently passing on my laptop but failing on my desktop unless I change the ports used in those unit tests.

In order to make unit tests more robust, I suggest using different ports in scheduler and descheduler unit tests. I'm happy to make this simple change if it looks good to you.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/flakeCategorizes issue or PR as related to a flaky test.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions