mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-27 15:16:35 +00:00
chore: fix test (#2055)
This commit is contained in:
@@ -171,7 +171,7 @@ func waitUntilListening(tb testing.TB, network, address string) error {
|
|||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
|
|
||||||
for range 10 {
|
for range 20 {
|
||||||
conn, err = net.DialTimeout(network, address, 100*time.Millisecond)
|
conn, err = net.DialTimeout(network, address, 100*time.Millisecond)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
_ = conn.Close()
|
_ = conn.Close()
|
||||||
@@ -184,6 +184,14 @@ func waitUntilListening(tb testing.TB, network, address string) error {
|
|||||||
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
var winErr windows.Errno
|
||||||
|
|
||||||
|
if errors.As(err, &winErr) {
|
||||||
|
return fmt.Errorf("listener not listening: %w (#%d)", winErr, uint32(winErr))
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt.Errorf("listener not listening: %w", err)
|
return fmt.Errorf("listener not listening: %w", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user