提交 89537665 authored 作者: Thomas Mueller Graf's avatar Thomas Mueller Graf

Improve test

上级 79f4a180
...@@ -138,7 +138,7 @@ public class TestTransactionStore extends TestBase { ...@@ -138,7 +138,7 @@ public class TestTransactionStore extends TestBase {
}; };
task.execute(); task.execute();
Transaction tx = null; Transaction tx = null;
int count = 10000; int count = 100000;
TransactionMap<Integer, Integer> map = null; TransactionMap<Integer, Integer> map = null;
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
int k = i; int k = i;
...@@ -152,6 +152,11 @@ public class TestTransactionStore extends TestBase { ...@@ -152,6 +152,11 @@ public class TestTransactionStore extends TestBase {
// ignore and retry // ignore and retry
} }
tx.commit(); tx.commit();
if (failCount.get() > 0 && i > 4000) {
// stop earlier, if possible
count = i;
break;
}
} }
// we expect at least 10% the operations were successful // we expect at least 10% the operations were successful
assertTrue(failCount.toString() + " >= " + (count * 0.9), assertTrue(failCount.toString() + " >= " + (count * 0.9),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论