Skip to content

Commit

Permalink
Bug 35575377 - Build: intermittent failure in ViewDistProcessorTests.…
Browse files Browse the repository at this point in the history
…updateAfterExpiry()

- converted all Eventually.assertThat()'s to assertDeferred()
(auto-submit 101613 after successfully running remote remote.full)
Job ID: job.9.20230710160607.14158
(auto-submit integ 101619 main -> coherence-ce/main after successfully running remote remote.full)
Job ID: job.9.20230711195922.26218

[git-p4: depot-paths = "//dev/coherence-ce/main/": change = 101672]
  • Loading branch information
fryp committed Jul 11, 2023
1 parent 63733c7 commit 7523a5a
Showing 1 changed file with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

package processor;


import com.oracle.bedrock.testsupport.deferred.Eventually;

import com.oracle.coherence.common.base.Continuation;
Expand Down Expand Up @@ -76,17 +75,13 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;

import static com.oracle.bedrock.deferred.DeferredHelper.invoking;
import static com.oracle.bedrock.deferred.DeferredHelper.valueOf;

import static org.hamcrest.CoreMatchers.is;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;


/**
* A collection of functional tests for the various
* {@link InvocableMap.EntryProcessor} implementations specific to the
Expand Down Expand Up @@ -128,11 +123,11 @@ public void expiry()
new ExpiryProcessor(ExpiryProcessor.Mode.UPDATE_NONE, 1L);
cache.invoke("key", processor);

Eventually.assertThat(invoking(cache).isEmpty(), is(true));
Eventually.assertDeferred(cache::isEmpty, is(true));

// ensure setting the expiry for a non-existent entry is a no-op
cache.invoke("key2", processor);
Eventually.assertThat(invoking(cache).isEmpty(), is(true));
Eventually.assertDeferred(cache::isEmpty, is(true));
}

/**
Expand All @@ -150,13 +145,13 @@ public void updateBeforeExpiry()
new ExpiryProcessor(ExpiryProcessor.Mode.UPDATE_BEFORE_BIN, 1L);
cache.invoke("key", processor);

Eventually.assertThat(invoking(cache).isEmpty(), is(true));
Eventually.assertDeferred(cache::isEmpty, is(true));

// ensure setting the value & expiry for a non-existent entry
// functions as expected
cache.invoke("key2", new ExpiryProcessor(ExpiryProcessor.Mode.UPDATE_BEFORE, 750L));
assertEquals("value2", cache.get("key2"));
Eventually.assertThat(invoking(cache).isEmpty(), is(true));
Eventually.assertDeferred(cache::isEmpty, is(true));
}

/**
Expand Down Expand Up @@ -206,7 +201,7 @@ public void async()
cache.invoke(oKey, new SingleEntryAsynchronousProcessor(proc0));
}

Eventually.assertThat(invoking(cache).size(), is(10));
Eventually.assertDeferred(cache::size, is(10));

// increment by 2 -> 2
EntryProcessor proc1 = new NumberIncrementor((ValueManipulator) null, Integer.valueOf(2), false);
Expand Down Expand Up @@ -260,9 +255,6 @@ public void async()
{
cache = getNamedCache();

SafeService safeService = (SafeService) cache.getCacheService();
PartitionedCache distService = (PartitionedCache) safeService.getService();

waitForBalanced(cache.getCacheService());

cache.invokeAll(AlwaysFilter.INSTANCE, aproc2);
Expand Down Expand Up @@ -329,7 +321,7 @@ public synchronized void proceed(Object o)

notifier.await(5000);

Eventually.assertThat(valueOf(atomicFlag), is(true));
Eventually.assertDeferred(atomicFlag::get, is(true));
break;
}
}
Expand Down Expand Up @@ -410,8 +402,8 @@ public void testSkipKeySerialization()
Eventually.assertDeferred(() -> distService.isDistributionStable(), is(true));

SerializationCountingKey.reset();
Eventually.assertThat(SerializationCountingKey.DESERIALIZATION_COUNTER.get(), is(0));
Eventually.assertThat(SerializationCountingKey.SERIALIZATION_COUNTER.get(), is(0));
Eventually.assertDeferred(SerializationCountingKey.DESERIALIZATION_COUNTER::get, is(0));
Eventually.assertDeferred(SerializationCountingKey.SERIALIZATION_COUNTER::get, is(0));

Map mapResults = cache.invokeAll(setKeys, new OptimizedGetAllProcessor());
Eventually.assertDeferred(mapResults::size, is(setKeys.size()));
Expand Down

0 comments on commit 7523a5a

Please sign in to comment.