From a29bf444ef7130b0525f337bb0d4716b789591e8 Mon Sep 17 00:00:00 2001 From: Arjun Kondur Date: Tue, 16 Jul 2024 19:05:35 -0500 Subject: [PATCH] Output peers in assets.conf for MC, add sleep --- test/monitoring_console/manager_monitoring_console_test.go | 7 +++++++ test/testenv/mcutil.go | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/test/monitoring_console/manager_monitoring_console_test.go b/test/monitoring_console/manager_monitoring_console_test.go index 42af80f06..291418c14 100644 --- a/test/monitoring_console/manager_monitoring_console_test.go +++ b/test/monitoring_console/manager_monitoring_console_test.go @@ -474,6 +474,10 @@ var _ = Describe("Monitoring Console test", func() { // Check Search Head Pods in Monitoring Console Config Map shPods := testenv.GeneratePodNameSlice(testenv.SearchHeadPod, deployment.GetName(), defaultSHReplicas, false, 0) testenv.VerifyPodsInMCConfigMap(ctx, deployment, testcaseEnvInst, shPods, "SPLUNK_SEARCH_HEAD_URL", mcName, true) + + // Add a sleep here in case MC pod restarts to add peers + time.Sleep(300 * time.Second) + // Check Monitoring console Pod is configured with all search head testenv.VerifyPodsInMCConfigString(ctx, deployment, testcaseEnvInst, shPods, mcName, true, false) @@ -651,6 +655,9 @@ var _ = Describe("Monitoring Console test", func() { // Verify Monitoring Console is Ready and stays in ready state testenv.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc, testcaseEnvInst) + // Adding a sleep, in case MC restarts to update peers list + time.Sleep(300 * time.Second) + // Check Monitoring console Pod is configured with all search head testenv.VerifyPodsInMCConfigString(ctx, deployment, testcaseEnvInst, shPods, mcName, true, false) diff --git a/test/testenv/mcutil.go b/test/testenv/mcutil.go index 36250ae96..284622202 100644 --- a/test/testenv/mcutil.go +++ b/test/testenv/mcutil.go @@ -79,6 +79,7 @@ func CheckMCPodReady(ns string) bool { func GetConfiguredPeers(ns string, mcName string) []string { podName := fmt.Sprintf(MonitoringConsolePod, mcName) var peerList []string + var output []byte if len(podName) > 0 { peerFile := "/opt/splunk/etc/apps/splunk_monitoring_console/local/splunk_monitoring_console_assets.conf" output, err := exec.Command("kubectl", "exec", "-n", ns, podName, "--", "cat", peerFile).Output() @@ -100,7 +101,7 @@ func GetConfiguredPeers(ns string, mcName string) []string { } } } - logf.Log.Info("Peer List found on MC Pod", "MC POD", podName, "Configured Peers", peerList) + logf.Log.Info("Peer List found on MC Pod", "MC POD", podName, "Configured Peers", peerList, "splunk_monitoring_console_assets.conf output", output) return peerList }