0

I've set up an Ant build script to run unit tests with Cobertura. I have a "timeout" attribute of "10000" in the "junit" task.

I've tested running my unit tests many times. For some reason, when I first run it after having not run it for a while (like first thing in the morning), I often see every single test case fail like this:

    Testsuite: ...
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec

Testcase: null took 0.109 sec
    Caused an ERROR
Timeout occurred. Please note the time in the report does not reflect the time until the timeout.
junit.framework.AssertionFailedError: Timeout occurred. Please note the time in the report does not reflect the time until the timeout.

Every time this has happened, I just rerun the command line and everything works. When it fails like this, it does delay a tiny bit before starting, but it's certainly not 10 seconds.

What can I do to prevent this from happening? It's one thing to happen when I run it manually from the command line, but it will be quite another when I have this set up to run from a CI server, where irrelevant failures will be much more annoying.

4

1 回答 1

0

我想我会称之为没有实际意义的。部分问题是 Cobertura 目前正在打印大量的调试输出,我猜这是导致问题的原因。当我添加'forkmode =“once”'时它有所帮助。他们正在努力为 Cobertura 添加一个“安静模式”,这将进一步提供帮助。

于 2012-11-13T22:49:06.410 回答