Skip to content

Commit 9beba58

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

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/helpers/health_events_analyzer.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,24 @@ func applyHealthEventsAnalyzerConfigAndRestart(
106106
return err
107107
}
108108

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

111118
err = RestartDeployment(ctx, t, client, "health-events-analyzer", NVSentinelNamespace)
112119
if err != nil {
113120
return err
114121
}
115122

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

0 commit comments

Comments
 (0)