reactive-async
reactive-async copied to clipboard
Several tests generate very suspicious output, but don't fail
When running the test suite (w.r.t. master or including the proposed changes in PR #40) core/test, I get messages such as:
problem with cell.CellImpl@744a46be; existing value: Success(20), new value: 5
and also
Exception in thread "ForkJoinPool-289-worker-1" java.lang.Exception: Even if this happens, quiescent handlers should still run. at cell.BaseSuite$$anonfun$42$$anonfun$apply$mcV$sp$43.apply(base.scala:933) at cell.BaseSuite$$anonfun$42$$anonfun$apply$mcV$sp$43.apply(base.scala:931) at scala.Function0$class.apply$mcV$sp(Function0.scala:34) at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12) at cell.HandlerPool$$anon$2.run(HandlerPool.scala:153) at cell.HandlerPool$$anon$3.run(HandlerPool.scala:168) at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402) at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
This strongly suggests that something is broken - however all tests are green.
The exception stack trace is harmless. In fact, it is explicitly mentioned in the corresponding test case (line 927, cell/base.scala):
pool.execute { () =>
// NOTE: This will print a stacktrace, but that is fine (not a bug).
throw new Exception(
"Even if this happens, quiescent handlers should still run.")
}
Ok; I see that it tests that exceptions don't destroy the handler pool.
But I would still expect the test to "catch the exception"; i.e. to check that the exception is thrown. I must admit it is most likely not trivial in this case. Do we have some means to tell the handler pool how to react on exceptions?
I agree.
However, we didn't have a way to tell the handler pool how to react to unhandled exceptions. Thus, I created PR https://github.com/phaller/reactive-async/pull/42 which adds that functionality and also removes the above spurious stack trace from the output when running the tests.
This has been fixed via #42 and can be closed.