Permalink
Browse files

ISPN-2547 - org.infinispan.loaders.decorators.AsyncStoreTest.testPutR…

…emove fails randomly
  • Loading branch information...
1 parent a7cb15c commit 4812ac3c9cb5190d52665ea134cdd81534c509ed @andyuk1986 andyuk1986 committed with Mircea Markus Mar 12, 2013
Showing with 16 additions and 5 deletions.
  1. +16 −5 core/src/test/java/org/infinispan/loaders/decorators/AsyncStoreTest.java
@@ -416,13 +416,24 @@ private void doTestSameKeyPut(int number, String key, String value) throws Excep
assert ice != null && (value + (number - 1)).equals(ice.getValue());
}
- private void doTestRemove(int number, String key) throws Exception {
+ private void doTestRemove(final int number, final String key) throws Exception {
for (int i = 0; i < number; i++) store.remove(key + i);
- for (int i = 0; i < number; i++) {
- String loadKey = key + i;
- assert store.load(loadKey) == null : loadKey + " still in store";
- }
+ eventually( new Condition() {
+ public boolean isSatisfied() throws Exception {
+ boolean allRemoved = true;
+
+ for (int i = 0; i < number; i++) {
+ String loadKey = key + i;
+ if(store.load(loadKey) != null) {
+ allRemoved = false;
+ break;
+ }
+ }
+
+ return allRemoved;
+ }
+ });
}
private void doTestSameKeyRemove(String key) throws Exception {

0 comments on commit 4812ac3

Please sign in to comment.