cassandra IndexSummaryManagerTest单元测试用例超时错误

时间:2015-05-19 00:43:39

标签: unit-testing build cassandra

编译cassandra单元测试用例时出错了。其中一项测试有时会超时。虽然https://issues.apache.org/jira/browse/CASSANDRA-8981表示此问题已在2.1.5版中得到解决,但我仍然遇到此问题。使用jdk1.8从源代码构建cassandra 2.1.5。以下是详细信息:

[junit] Testsuite: org.apache.cassandra.io.sstable.IndexSummaryManagerTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec
[junit] 
[junit] Testcase: org.apache.cassandra.io.sstable.IndexSummaryManagerTest:testCompactionRace:   Caused an ERROR
[junit] Timeout occurred. Please note the time in the report does not reflect the time until the timeout.
[junit] junit.framework.AssertionFailedError: Timeout occurred. Please note the time in the report does not reflect the time until the timeout.
[junit]     at java.lang.Thread.run(Thread.java:745)
[junit] 
[junit] 
[junit] Test org.apache.cassandra.io.sstable.IndexSummaryManagerTest FAILED (timeout)
[junit] Testsuite: org.apache.cassandra.io.sstable.IndexSummaryTest
[junit] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.193 sec

1 个答案:

答案 0 :(得分:1)

参加Cassandra测试讨论的最佳地点可能是IRC频道#cassandra-dev on irc.freenode.net [0] - Cassandra开发人员和测试工程师都在那里闲逛并每天讨论这类事情:我偶尔会碰巧在这里浏览Cassandra标签,并且已经抓住了你最近的几个测试题。

关于您的特定测试错误,我快速查看了最近的CI历史记录[1]并且没有看到任何最近的超时 - 这并不意味着测试无法在您的帮助下得到改善,如果你发现了问题。

我不确定为什么要测试的系统类型,但可能I / O很慢,这可能会使测试花费的时间超过默认的60秒测试超时。首先将build.xml中的超时设置为更高,以查看测试是否至少最终通过 - 让它加倍:

(cassandra-2.1 *)mshuler@hana:~/git/cassandra$ git diff
diff --git a/build.xml b/build.xml
index e197696..2d5e20a 100644
--- a/build.xml
+++ b/build.xml
@@ -91,7 +91,7 @@
     <property name="maven-repository-url" value="https://repository.apache.org/content/repositories/snapshots"/>
     <property name="maven-repository-id" value="apache.snapshots.https"/>

-    <property name="test.timeout" value="60000" />
+    <property name="test.timeout" value="120000" />
     <property name="test.long.timeout" value="600000" />

     <!-- default for cql tests. Can be override by -Dcassandra.test.use_prepared=false -->

再次构建和测试(输出剪切):

(cassandra-2.1 *)mshuler@hana:~/cassandra$ ant clean jar
<...>
(cassandra-2.1 *)mshuler@hana:~/cassandra$ ant test -Dtest.name=IndexSummaryManagerTest
<...>
testlist:
     [echo] running test bucket 0 tests
    [mkdir] Created dir: /home/mshuler/cassandra/build/test/cassandra
    [mkdir] Created dir: /home/mshuler/cassandra/build/test/output
    [junit] WARNING: multiple versions of ant detected in path for junit 
    [junit]          jar:file:/usr/share/ant/lib/ant.jar!/org/apache/tools/ant/Project.class
    [junit]      and jar:file:/home/mshuler/cassandra/build/lib/jars/ant-1.6.5.jar!/org/apache/tools/ant/Project.class
    [junit] Testsuite: org.apache.cassandra.io.sstable.IndexSummaryManagerTest
    [junit] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 14.737 sec
    [junit] 

BUILD SUCCESSFUL
Total time: 18 seconds

如果仍有问题,请查看test system.log文件,看看是否可以解决问题所在。您将在build/test/logs/system.log找到该日志文件。

如果您可以识别问题并且可以提供复制步骤,请打开JIRA票证......事实上,在测试所有蚂蚁目标期间,我似乎重新打开了不同的JIRA用于此测试时间:{{ 3}}

我会继续发布这个答案,因为上面至少是你应该在测试工具箱中使用的几个工具。不过,欢迎来IRC聊天!

[0] https://issues.apache.org/jira/browse/CASSANDRA-9271

[1] http://freenode.net/