Skip to content

Commit cd4cf02

Browse files
committed
Try Splunk Tests Again
1 parent c44b8fa commit cd4cf02

File tree

2 files changed

+10
-36
lines changed

2 files changed

+10
-36
lines changed

contrib/storage-splunk/src/main/java/org/apache/drill/exec/store/splunk/SplunkBatchReader.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,6 @@ public void close() {
142142
AutoCloseables.closeSilently(searchResults);
143143
searchResults = null;
144144
}
145-
// Logout from Splunk service to properly cleanup session
146-
if (splunkService != null) {
147-
try {
148-
splunkService.logout();
149-
} catch (Exception e) {
150-
logger.warn("Error logging out from Splunk service", e);
151-
}
152-
}
153145
}
154146

155147
/**

contrib/storage-splunk/src/test/java/org/apache/drill/exec/store/splunk/SplunkTestSuite.java

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -89,39 +89,21 @@ public static void initSplunk() throws Exception {
8989

9090
splunk.start();
9191

92-
// Clean up any existing dispatch files from previous runs
93-
logger.info("Cleaning up Splunk dispatch directory...");
94-
try {
95-
splunk.execInContainer("sudo", "rm", "-rf", "/opt/splunk/var/run/splunk/dispatch/*");
96-
} catch (Exception e) {
97-
logger.warn("Could not clean dispatch directory (may not exist yet): " + e.getMessage());
98-
}
99-
100-
// Configure Splunk to use minimal disk space for tests
101-
logger.info("Configuring Splunk disk usage settings...");
102-
splunk.execInContainer("sudo", "chmod", "a+w", "/opt/splunk/etc/system/local/server.conf");
103-
104-
// Remove any existing [diskUsage] section
105-
splunk.execInContainer("sudo", "sed", "-i", "/\\[diskUsage\\]/,/^$/d", "/opt/splunk/etc/system/local/server.conf");
106-
107-
// Add new [diskUsage] section with minimal requirements
108-
splunk.execInContainer("sudo", "sh", "-c",
92+
// Disable disk usage monitoring in Splunk to prevent "minimum free disk space" errors in CI
93+
logger.info("Configuring Splunk to disable disk usage monitoring...");
94+
splunk.execInContainer("sh", "-c",
10995
"echo '' >> /opt/splunk/etc/system/local/server.conf && " +
110-
"echo '# disk usage processor settings for testing' >> /opt/splunk/etc/system/local/server.conf && " +
11196
"echo '[diskUsage]' >> /opt/splunk/etc/system/local/server.conf && " +
11297
"echo 'minFreeSpace = 50' >> /opt/splunk/etc/system/local/server.conf && " +
113-
"echo 'pollingFrequency = 100000' >> /opt/splunk/etc/system/local/server.conf && " +
114-
"echo 'pollingTimerFrequency = 10' >> /opt/splunk/etc/system/local/server.conf");
115-
116-
splunk.execInContainer("sudo", "chmod", "600", "/opt/splunk/etc/system/local/server.conf");
98+
"echo 'disabled = false' >> /opt/splunk/etc/system/local/server.conf");
11799

118-
// Restart Splunk to apply changes
119-
logger.info("Restarting Splunk to apply disk usage settings...");
120-
splunk.execInContainer("sudo", "/opt/splunk/bin/splunk", "restart");
100+
// Restart Splunk to apply configuration
101+
logger.info("Restarting Splunk with updated configuration...");
102+
splunk.execInContainer("/opt/splunk/bin/splunk", "restart", "--accept-license", "--answer-yes", "--no-prompt");
121103

122-
// Wait for Splunk to fully restart
123-
Thread.sleep(15000);
124-
logger.info("Splunk restarted with minimal disk usage requirements");
104+
// Wait for Splunk to fully restart and be ready
105+
logger.info("Waiting for Splunk to be ready...");
106+
Thread.sleep(45000);
125107

126108
String hostname = splunk.getHost();
127109
Integer port = splunk.getFirstMappedPort();

0 commit comments

Comments
 (0)