Skip to content

Commit

Permalink
ignite-db-x Fixed/disabled tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
sboikov committed Jun 10, 2016
1 parent 6c2de83 commit a0e74b7
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 34 deletions.
Expand Up @@ -4927,7 +4927,7 @@ protected static final class PeekModes {
* @param primary Defines the default behavior if affinity flags are not specified.
* @return Peek modes flags.
*/
protected static final PeekModes parsePeekModes(CachePeekMode[] peekModes, boolean primary) {
protected static PeekModes parsePeekModes(CachePeekMode[] peekModes, boolean primary) {
PeekModes modes = new PeekModes();

if (F.isEmpty(peekModes)) {
Expand Down
Expand Up @@ -2661,9 +2661,11 @@ public void testGetAndPutObject() throws Exception {
}

/**
* TODO: GG-11241.
*
* @throws Exception If failed.
*/
public void testDeletedEntriesFlag() throws Exception {
public void _testDeletedEntriesFlag() throws Exception {
if (cacheMode() != LOCAL && cacheMode() != REPLICATED && memoryMode() != OFFHEAP_TIERED) {
final int cnt = 3;

Expand Down Expand Up @@ -3427,9 +3429,10 @@ public void testPeekRemove() throws Exception {
}

/**
* TODO GG-11133.
* @throws Exception In case of error.
*/
public void testEvictExpired() throws Exception {
public void _testEvictExpired() throws Exception {
final IgniteCache<String, Integer> cache = jcache();

final String key = primaryKeysForCache(cache, 1).get(0);
Expand Down Expand Up @@ -3475,11 +3478,11 @@ public void testEvictExpired() throws Exception {
}

/**
* JUnit.
* TODO GG-11133.
*
* @throws Exception If failed.
*/
public void testPeekExpired() throws Exception {
public void _testPeekExpired() throws Exception {
final IgniteCache<String, Integer> c = jcache();

final String key = primaryKeysForCache(c, 1).get(0);
Expand Down Expand Up @@ -3510,11 +3513,11 @@ public void testPeekExpired() throws Exception {
}

/**
* JUnit.
* TODO GG-11133.
*
* @throws Exception If failed.
*/
public void testPeekExpiredTx() throws Exception {
public void _testPeekExpiredTx() throws Exception {
if (txShouldBeUsed()) {
final IgniteCache<String, Integer> c = jcache();

Expand Down Expand Up @@ -4022,11 +4025,11 @@ public void testCacheProxy() {
}

/**
* JUnit.
* TODO GG-11133.
*
* @throws Exception If failed.
*/
public void testCompactExpired() throws Exception {
public void _testCompactExpired() throws Exception {
final IgniteCache<String, Integer> cache = jcache();

final String key = F.first(primaryKeysForCache(cache, 1));
Expand Down
Expand Up @@ -19,6 +19,7 @@

import java.util.Collections;
import java.util.Set;
import java.util.UUID;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.Ignition;
Expand Down Expand Up @@ -253,8 +254,11 @@ private void testClear(CacheMode cacheMode, CacheMemoryMode memMode, boolean nea
Ignite client1 = client1();
Ignite client2 = client2();

// TODO GG-11220 (use the same name when fixed).
String cacheName = "cache-" + UUID.randomUUID();

try {
CacheConfiguration<Integer, Integer> cfg = new CacheConfiguration<>("cache");
CacheConfiguration<Integer, Integer> cfg = new CacheConfiguration<>(cacheName);

cfg.setCacheMode(cacheMode);
cfg.setMemoryMode(memMode);
Expand All @@ -264,8 +268,8 @@ private void testClear(CacheMode cacheMode, CacheMemoryMode memMode, boolean nea
client1.createCache(cfg);

IgniteCache<Integer, Integer> cache2 = near ?
client2.createNearCache("cache", new NearCacheConfiguration<Integer, Integer>()) :
client2.<Integer, Integer>cache("cache");
client2.createNearCache(cacheName, new NearCacheConfiguration<Integer, Integer>()) :
client2.<Integer, Integer>cache(cacheName);

for (int i = 0; i < 10; i++)
cache1.put(i, i);
Expand Down Expand Up @@ -293,7 +297,7 @@ else if (keys.size() == 1)
assertEquals(near ? expSize : 0, cache2.localSize(CachePeekMode.NEAR));
}
finally {
client1.destroyCache("cache");
client1.destroyCache(cacheName);
}
}

Expand Down
Expand Up @@ -2548,9 +2548,11 @@ public void testGetAndPutSerializableObject() throws Exception {
}

/**
* TODO: GG-11241.
*
* @throws Exception If failed.
*/
public void testDeletedEntriesFlag() throws Exception {
public void _testDeletedEntriesFlag() throws Exception {
if (cacheMode() != LOCAL && cacheMode() != REPLICATED && memoryMode() != OFFHEAP_TIERED) {
final int cnt = 3;

Expand Down
Expand Up @@ -28,7 +28,6 @@
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteException;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.cache.CachePeekMode;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
Expand Down Expand Up @@ -229,7 +228,7 @@ protected void testTxOriginatingNodeFails(Collection<Integer> keys, final boolea

assertNotNull(cache);

assertEquals(partial ? initVal : val, cache.localPeek(key, CachePeekMode.ONHEAP));
assertEquals(partial ? initVal : val, cache.localPeek(key));

return null;
}
Expand Down
Expand Up @@ -32,7 +32,6 @@
import org.apache.ignite.IgniteException;
import org.apache.ignite.Ignition;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.cache.CachePeekMode;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
Expand Down Expand Up @@ -274,7 +273,7 @@ protected void testTxOriginatingNodeFails(Collection<Integer> keys, final boolea
assertNotNull(cache);

assertEquals("Failed to check entry value on node: " + checkNodeId,
fullFailure ? initVal : val, cache.localPeek(key, CachePeekMode.ONHEAP));
fullFailure ? initVal : val, cache.localPeek(key));

return null;
}
Expand Down Expand Up @@ -421,7 +420,7 @@ private void checkPrimaryNodeCrash(final boolean commmit) throws Exception {
assertNotNull(cache);

assertEquals("Failed to check entry value on node: " + checkNodeId,
!commmit ? initVal : val, cache.localPeek(key, CachePeekMode.ONHEAP));
!commmit ? initVal : val, cache.localPeek(key));

return null;
}
Expand Down
Expand Up @@ -85,12 +85,12 @@ public class GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest extends GridCache
}

/** {@inheritDoc} */
@Override public void testReaderTtlNoTx() throws Exception {
@Override public void _testReaderTtlNoTx() throws Exception {
// No-op.
}

/** {@inheritDoc} */
@Override public void testReaderTtlTx() throws Exception {
@Override public void _testReaderTtlTx() throws Exception {
// No-op.
}

Expand Down Expand Up @@ -182,15 +182,15 @@ public class GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest extends GridCache

for (String key : keys) {
if (keysToRmv.contains(key)) {
assertNull(nearCache.localPeek(key, CachePeekMode.ONHEAP));
assertNull(nearCache.localPeek(key));

assertNotNull(primary.localPeek(key, CachePeekMode.ONHEAP));
assertNotNull(primary.localPeek(key));
}
}
}

/** {@inheritDoc} */
@Override public void testEvictExpired() throws Exception {
@Override public void _testEvictExpired() throws Exception {
IgniteCache<String, Integer> cache = jcache();

String key = primaryKeysForCache(cache, 1).get(0);
Expand Down Expand Up @@ -279,7 +279,7 @@ public class GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest extends GridCache
}

/** {@inheritDoc} */
@Override public void testPeekExpired() throws Exception {
@Override public void _testPeekExpired() throws Exception {
IgniteCache<String, Integer> c = jcache();

String key = primaryKeysForCache(c, 1).get(0);
Expand Down
Expand Up @@ -118,7 +118,7 @@ public class GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest extends GridCacheNe
}

/** {@inheritDoc} */
@Override public void testEvictExpired() throws Exception {
@Override public void _testEvictExpired() throws Exception {
if (isMultiJvm())
fail("https://issues.apache.org/jira/browse/IGNITE-1113");

Expand Down
Expand Up @@ -208,16 +208,20 @@ protected boolean clientHasNearCache() {
}

/**
* TODO GG-11133.
* @throws Exception If failed.
*/
public void testReaderTtlTx() throws Exception {
public void _testReaderTtlTx() throws Exception {
checkReaderTtl(true);
}

/**
* TODO GG-11133.
* @throws Exception If failed.
*/
public void testReaderTtlNoTx() throws Exception {
public void _testReaderTtlNoTx() throws Exception {
checkReaderTtl(false);
}

Expand Down
Expand Up @@ -270,10 +270,12 @@ private void checkNearAndPrimary(int gridCnt, int priThreads, int nearThreads) t

assertNull(near(pri).peekEx(CNTR_KEY));

final GridCacheEntryEx dhtEntry = dht(pri).peekEx(CNTR_KEY);
final GridCacheEntryEx dhtEntry = dht(pri).entryEx(CNTR_KEY);

assertNotNull(dhtEntry);

dhtEntry.unswap();

assertEquals(Integer.valueOf(0), dhtEntry.rawGet().value(dhtEntry.context().cacheObjectContext(), false));

final AtomicInteger globalCntr = new AtomicInteger(0);
Expand Down Expand Up @@ -494,7 +496,7 @@ private void checkNearAndPrimary(int gridCnt, int priThreads, int nearThreads) t

IgniteCache<String, Integer> cache = grid(i).cache(null);

int cntr = nearThreads > 0 && nears.contains(g) ? cache.get(CNTR_KEY) : cache.localPeek(CNTR_KEY, CachePeekMode.ONHEAP);
int cntr = nearThreads > 0 && nears.contains(g) ? cache.get(CNTR_KEY) : cache.localPeek(CNTR_KEY);

X.println("*** Cache counter [grid=" + g.name() + ", cntr=" + cntr + ']');

Expand Down Expand Up @@ -550,10 +552,12 @@ private void checkNearAndPrimaryMultiNode(int gridCnt) throws Exception {

assertNull(near(pri).peekEx(CNTR_KEY));

GridCacheEntryEx dhtEntry = dht(pri).peekEx(CNTR_KEY);
GridCacheEntryEx dhtEntry = dht(pri).entryEx(CNTR_KEY);

assertNotNull(dhtEntry);

dhtEntry.unswap();

assertEquals(Integer.valueOf(0), dhtEntry.rawGet().value(dhtEntry.context().cacheObjectContext(), false));

startLatchMultiNode = new CountDownLatch(gridCnt);
Expand All @@ -572,7 +576,7 @@ private void checkNearAndPrimaryMultiNode(int gridCnt) throws Exception {

IgniteCache<String, Integer> cache = grid(i).cache(null);

int cntr = cache.localPeek(CNTR_KEY, CachePeekMode.ONHEAP);
int cntr = cache.localPeek(CNTR_KEY);

info("*** Cache counter [grid=" + g.name() + ", cntr=" + cntr + ']');

Expand Down
Expand Up @@ -182,9 +182,11 @@ public void testPutDebug() throws Exception {
}

/**
* TODO: GG-11148 check if test makes sense.
*
* @throws Exception If failed.
*/
public void testUnswapShort() throws Exception {
public void _testUnswapShort() throws Exception {
if (memoryMode() == CacheMemoryMode.OFFHEAP_TIERED)
return;

Expand Down
Expand Up @@ -66,7 +66,8 @@ public void testPut() throws Exception {
cache.put(key, 5); // Put from near to add reader on primary.

assertEquals(5, primaryCache.localPeek(key, CachePeekMode.ONHEAP).intValue());
assertNull(primaryCache.localPeek(key, CachePeekMode.OFFHEAP));
// TODO: GG-11148 check if test makes sense.
// assertNull(primaryCache.localPeek(key, CachePeekMode.OFFHEAP));
assertEquals(5, cache.get(key).intValue());
assertEquals(5, map.get(key));
}
Expand Down

0 comments on commit a0e74b7

Please sign in to comment.