Skip to content

Commit 2cba454

Browse files
committed
add timeout
Signed-off-by: Davanum Srinivas <[email protected]>
1 parent d230f0f commit 2cba454

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/helpers/health_events_analyzer.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"context"
1919
"math/rand"
2020
"testing"
21+
"time"
2122

2223
pb "github.com/nvidia/nvsentinel/data-models/pkg/protos"
2324
"github.com/stretchr/testify/require"
@@ -106,13 +107,24 @@ func applyHealthEventsAnalyzerConfigAndRestart(
106107
return err
107108
}
108109

110+
// CRITICAL: Wait for ConfigMap to propagate to mounted volumes
111+
// Kubernetes kubelet syncs ConfigMaps to pod volumes periodically (default sync period: 60s).
112+
// Without this wait, restarted pods can read stale config from unmounted volumes.
113+
// See: https://kubernetes.io/docs/concepts/configuration/configmap/#mounted-configmaps-are-updated-automatically
114+
t.Log("Waiting 15 seconds for ConfigMap propagation to pod volumes")
115+
time.Sleep(15 * time.Second)
116+
109117
t.Log("Restarting health-events-analyzer deployment")
110118

111119
err = RestartDeployment(ctx, t, client, "health-events-analyzer", NVSentinelNamespace)
112120
if err != nil {
113121
return err
114122
}
115123

124+
// Additional wait after deployment restart to ensure config is fully loaded
125+
t.Log("Waiting 10 seconds after restart for config to be loaded by new pod")
126+
time.Sleep(10 * time.Second)
127+
116128
return nil
117129
}
118130

0 commit comments

Comments
 (0)