discovery/kubernetes: improve test logic for waiting for discoverers (#9584)
discovery/kubernetes: improve test logic for waiting for discoverers (#9584)

When running tests in parallel, 10 milliseconds may not be enough for
all discoverers to register, which will make test flaky.

This commit changes the waiting logic to wait for number of discoverers
to stop increasing during given time frame, which should be large enough
for single discoverer to register in test environment.

A following run passes with this commit:

go test -failfast -race -count 100 -v ./discovery/kubernetes/

Signed-off-by: Mateusz Gozdek <13f764135ff35d07236cdb9e39f2edb4395b2583@gmail.com>
alileza/prometheus,keegancsmith/prometheus,prometheus/prometheus,alileza/prometheus,alileza/prometheus,alileza/prometheus,keegancsmith/prometheus,keegancsmith/prometheus,prometheus/prometheus,alileza/prometheus,prometheus/prometheus,prometheus/prometheus,prometheus/prometheus,keegancsmith/prometheus,keegancsmith/prometheus