From cd4c9e87285a6d7db451407277f26046b1d287c5 Mon Sep 17 00:00:00 2001 From: parrt Date: Wed, 30 Nov 2016 08:27:05 -0800 Subject: [PATCH] Add heartbeat thread to gen minimal output for travis, appveyor to avoid timeout. --- .../v4/test/runtime/BaseRuntimeTest.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseRuntimeTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseRuntimeTest.java index de5096025..e0b5768a9 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseRuntimeTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseRuntimeTest.java @@ -49,6 +49,26 @@ public abstract class BaseRuntimeTest { "Node", "Safari", "Firefox", "Explorer", "Chrome" }; + static { + // Add heartbeat thread to gen minimal output for travis, appveyor to + // avoid timeout. + Thread t = new Thread("heartbeat") { + @Override + public void run() { + while (true) { + System.out.print('.'); + try { + Thread.sleep(5000); + } + catch (Exception e) { + e.printStackTrace(); + } + } + } + }; + t.start(); + } + /** ANTLR isn't thread-safe to process grammars so we use a global lock for testing */ public static final Object antlrLock = new Object();