File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change 1818
1919import org .junit .Test ;
2020
21+ import java .io .File ;
22+ import java .io .FileWriter ;
23+ import java .io .IOException ;
24+ import java .util .Date ;
25+
2126public class UploadTest extends SDKTestCase {
2227 @ Test
23- public void testOneshot () throws InterruptedException {
24- // Slow down for CI to wait for splunkd.log to exist
25- Thread .sleep (8000 );
26-
28+ public void testOneshot () throws IOException {
2729 String filename = locateSystemLog ();
28- if (System .getenv ("SPLUNK_HOME" ) != null ) {
30+ if (System .getenv ("TRAVIS_CI" ) != null ) {
31+ File tempfile = File .createTempFile ((new Date ()).toString (), "" );
32+ tempfile .deleteOnExit ();
33+
34+ FileWriter f = new FileWriter (tempfile , true );
35+ f .append ("some data here" );
36+
37+ filename = tempfile .getAbsolutePath ();
38+ }
39+ else if (System .getenv ("SPLUNK_HOME" ) != null ) {
2940 filename = System .getenv ("SPLUNK_HOME" ) + "/var/log/splunk/splunkd.log" ;
3041 }
31-
3242 service .getUploads ().create (filename );
3343
3444 for (Upload oneshot : service .getUploads ().values ()) {
You can’t perform that action at this time.
0 commit comments