@Test
@Ignore
public void issue28() throws InterruptedException {
changeRedisTimeout(10);
TestUtils.enqueueJobs("longRunning", Arrays.asList(new Job("LongRunningAction", 20 * 1000L)), config);
final Worker worker2 = new WorkerImpl(config, Arrays.asList("longRunning"),
new MapBasedJobFactory(map(entry("LongRunningAction", LongRunningAction.class))));
final AtomicBoolean successRef = new AtomicBoolean(false);
worker2.getWorkerEventEmitter().addListener(new WorkerListener() {
@Override
public void onEvent(final WorkerEvent event, final Worker worker, final String queue, final Job job,
final Object runner, final Object result, final Throwable t) {
successRef.set(true);
log.info("SUCCCESS: {}", job);
}
}, WorkerEvent.JOB_SUCCESS);
final Thread workerThread2 = new Thread(worker2);
workerThread2.start();
sleepTight(1000);
worker2.end(false);
workerThread2.join();
Assert.assertTrue("Success callback should have been called", successRef.get());
changeRedisTimeout(0);
}