Browse Source

Revert slow tests heartbeat

This commit reverts the slow tests heartbeat added in
b6fbd18e091de7b22ba8020241d01ce5dfd8accc. The heartbeat has not served
its stated purpose of drawing attention to slow tests, and the heartbeat
can kill builds with SELinux enforcing enabled. While the heartbeats can
be disabled via the environment variable PULSE_SERVER, and SELinux
policy files can be changed, since the heartbeats are not accomplishing
their intended purpose they should be removed.

Relates #19071
Jason Tedor 9 years ago
parent
commit
7c87d39f0c

+ 0 - 33
buildSrc/src/main/groovy/com/carrotsearch/gradle/junit4/TestReportLogger.groovy

@@ -28,12 +28,6 @@ import org.gradle.api.logging.LogLevel
 import org.gradle.api.logging.Logger
 import org.junit.runner.Description
 
-import javax.sound.sampled.AudioSystem
-import javax.sound.sampled.Clip
-import javax.sound.sampled.Line
-import javax.sound.sampled.LineEvent
-import javax.sound.sampled.LineListener
-import java.util.concurrent.atomic.AtomicBoolean
 import java.util.concurrent.atomic.AtomicInteger
 
 import static com.carrotsearch.ant.tasks.junit4.FormattingUtils.formatDescription
@@ -123,36 +117,9 @@ class TestReportLogger extends TestsSummaryEventListener implements AggregatedEv
                 formatTime(e.getCurrentTime()) + ", stalled for " +
                 formatDurationInSeconds(e.getNoEventDuration()) + " at: " +
                 (e.getDescription() == null ? "<unknown>" : formatDescription(e.getDescription())))
-        try {
-            playBeat();
-        } catch (Exception nosound) { /* handling exceptions with style */ }
         slowTestsFound = true
     }
 
-    void playBeat() throws Exception {
-        Clip clip = (Clip)AudioSystem.getLine(new Line.Info(Clip.class));
-        final AtomicBoolean stop = new AtomicBoolean();
-        clip.addLineListener(new LineListener() {
-            @Override
-            public void update(LineEvent event) {
-                if (event.getType() == LineEvent.Type.STOP) {
-                    stop.set(true);
-                }
-            }
-        });
-        InputStream stream = getClass().getResourceAsStream("/beat.wav");
-        try {
-            clip.open(AudioSystem.getAudioInputStream(stream));
-            clip.start();
-            while (!stop.get()) {
-                Thread.sleep(20);
-            }
-            clip.close();
-        } finally {
-            stream.close();
-        }
-    }
-
     @Subscribe
     void onQuit(AggregatedQuitEvent e) throws IOException {
         if (config.showNumFailuresAtEnd > 0 && !failedTests.isEmpty()) {

BIN
buildSrc/src/main/resources/beat.wav