Reduce test delays introduced in commit
from 3 seconds to 50
milliseconds. This reduces running this test case from 43 to 3 seconds.
Watch this test in Jenkins to make sure it still passes. It runs fine
over and over in Eclipse and 'mvn test -pl log4j-core
Dtest=KafkaAppenderTest'
@@ -50,21 +50,16 @@ import static org.junit.Assert.*;
public class KafkaAppenderTest {
private static final MockProducer<byte[], byte[]> kafka = new MockProducer<byte[], byte[]>(true, null, null) {
- @Override
- public void close() {
- try {
- Thread.sleep(3000);
- } catch (final InterruptedException ignore) {
- }
- }
@Override
public void close(final long timeout, final TimeUnit timeUnit) {
try {
- Thread.sleep(timeUnit.toMillis(timeout));
+ Thread.sleep(50);
} catch (final InterruptedException ignore) {
+ // ignore
}
}
+
};
private static final String LOG_MESSAGE = "Hello, world!";
