mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Fix flakiness in windows tests (#10983)
Our windows CI is too slow, process takes lots of time to start. Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
This commit is contained in:
parent
6af2f9ff5e
commit
7a2d24b76a
|
@ -38,6 +38,8 @@ import (
|
||||||
"github.com/prometheus/prometheus/rules"
|
"github.com/prometheus/prometheus/rules"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const startupTime = 10 * time.Second
|
||||||
|
|
||||||
var (
|
var (
|
||||||
promPath = os.Args[0]
|
promPath = os.Args[0]
|
||||||
promConfig = filepath.Join("..", "..", "documentation", "examples", "prometheus.yml")
|
promConfig = filepath.Join("..", "..", "documentation", "examples", "prometheus.yml")
|
||||||
|
@ -226,7 +228,7 @@ func TestWALSegmentSizeBounds(t *testing.T) {
|
||||||
select {
|
select {
|
||||||
case err := <-done:
|
case err := <-done:
|
||||||
t.Errorf("prometheus should be still running: %v", err)
|
t.Errorf("prometheus should be still running: %v", err)
|
||||||
case <-time.After(5 * time.Second):
|
case <-time.After(startupTime):
|
||||||
prom.Process.Kill()
|
prom.Process.Kill()
|
||||||
<-done
|
<-done
|
||||||
}
|
}
|
||||||
|
@ -272,7 +274,7 @@ func TestMaxBlockChunkSegmentSizeBounds(t *testing.T) {
|
||||||
select {
|
select {
|
||||||
case err := <-done:
|
case err := <-done:
|
||||||
t.Errorf("prometheus should be still running: %v", err)
|
t.Errorf("prometheus should be still running: %v", err)
|
||||||
case <-time.After(5 * time.Second):
|
case <-time.After(startupTime):
|
||||||
prom.Process.Kill()
|
prom.Process.Kill()
|
||||||
<-done
|
<-done
|
||||||
}
|
}
|
||||||
|
@ -366,7 +368,7 @@ func TestAgentSuccessfulStartup(t *testing.T) {
|
||||||
case err := <-done:
|
case err := <-done:
|
||||||
t.Logf("prometheus agent should be still running: %v", err)
|
t.Logf("prometheus agent should be still running: %v", err)
|
||||||
actualExitStatus = prom.ProcessState.ExitCode()
|
actualExitStatus = prom.ProcessState.ExitCode()
|
||||||
case <-time.After(5 * time.Second):
|
case <-time.After(startupTime):
|
||||||
prom.Process.Kill()
|
prom.Process.Kill()
|
||||||
}
|
}
|
||||||
require.Equal(t, 0, actualExitStatus)
|
require.Equal(t, 0, actualExitStatus)
|
||||||
|
@ -387,7 +389,7 @@ func TestAgentFailedStartupWithServerFlag(t *testing.T) {
|
||||||
case err := <-done:
|
case err := <-done:
|
||||||
t.Logf("prometheus agent should not be running: %v", err)
|
t.Logf("prometheus agent should not be running: %v", err)
|
||||||
actualExitStatus = prom.ProcessState.ExitCode()
|
actualExitStatus = prom.ProcessState.ExitCode()
|
||||||
case <-time.After(5 * time.Second):
|
case <-time.After(startupTime):
|
||||||
prom.Process.Kill()
|
prom.Process.Kill()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -411,7 +413,7 @@ func TestAgentFailedStartupWithInvalidConfig(t *testing.T) {
|
||||||
case err := <-done:
|
case err := <-done:
|
||||||
t.Logf("prometheus agent should not be running: %v", err)
|
t.Logf("prometheus agent should not be running: %v", err)
|
||||||
actualExitStatus = prom.ProcessState.ExitCode()
|
actualExitStatus = prom.ProcessState.ExitCode()
|
||||||
case <-time.After(5 * time.Second):
|
case <-time.After(startupTime):
|
||||||
prom.Process.Kill()
|
prom.Process.Kill()
|
||||||
}
|
}
|
||||||
require.Equal(t, 2, actualExitStatus)
|
require.Equal(t, 2, actualExitStatus)
|
||||||
|
@ -462,7 +464,7 @@ func TestModeSpecificFlags(t *testing.T) {
|
||||||
select {
|
select {
|
||||||
case err := <-done:
|
case err := <-done:
|
||||||
t.Errorf("prometheus should be still running: %v", err)
|
t.Errorf("prometheus should be still running: %v", err)
|
||||||
case <-time.After(5 * time.Second):
|
case <-time.After(startupTime):
|
||||||
prom.Process.Kill()
|
prom.Process.Kill()
|
||||||
<-done
|
<-done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue