From a0cc3d5d74602515c4f0a7737da197cf7071a076 Mon Sep 17 00:00:00 2001 From: dominictootell Date: Sun, 25 Sep 2016 13:46:20 +0100 Subject: [PATCH] reduce iterations --- ...nfigReconnectionElastiCacheMemcachedCaching.java | 2 +- .../TestMultipleForceConfigReconnection.java | 13 +++++++++---- ...estMultipleHostsElastiCacheMemcachedCaching.java | 2 +- ...NonCachingConfigElastiCacheMemcachedCaching.java | 2 +- .../TestNoHostsElastiCacheMemcachedCaching.java | 2 +- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/test/java/org/greencheek/caching/herdcache/memcached/TestForceConfigReconnectionElastiCacheMemcachedCaching.java b/src/test/java/org/greencheek/caching/herdcache/memcached/TestForceConfigReconnectionElastiCacheMemcachedCaching.java index 3fafcef..4edb835 100644 --- a/src/test/java/org/greencheek/caching/herdcache/memcached/TestForceConfigReconnectionElastiCacheMemcachedCaching.java +++ b/src/test/java/org/greencheek/caching/herdcache/memcached/TestForceConfigReconnectionElastiCacheMemcachedCaching.java @@ -146,7 +146,7 @@ private void testCaching(CacheWithExpiry cache) { Map> cacheWrites = new HashMap<>(200); - for(int i=0;i<200;i++) { + for(int i=0;i<20;i++) { final String uuidKey = UUID.randomUUID().toString(); cacheWrites.put(uuidKey, cache.apply(uuidKey, () -> { return uuidKey; diff --git a/src/test/java/org/greencheek/caching/herdcache/memcached/TestMultipleForceConfigReconnection.java b/src/test/java/org/greencheek/caching/herdcache/memcached/TestMultipleForceConfigReconnection.java index 42c5248..b56b1e5 100644 --- a/src/test/java/org/greencheek/caching/herdcache/memcached/TestMultipleForceConfigReconnection.java +++ b/src/test/java/org/greencheek/caching/herdcache/memcached/TestMultipleForceConfigReconnection.java @@ -145,7 +145,7 @@ private void testCaching(CacheWithExpiry cache) { Map> cacheWrites = new HashMap<>(200); - for(int i=0;i<200;i++) { + for(int i=0;i<10;i++) { final String uuidKey = UUID.randomUUID().toString(); cacheWrites.put(uuidKey, cache.apply(uuidKey, () -> { return uuidKey; @@ -183,6 +183,11 @@ private void testHashAlgorithm(HashAlgorithm algo) { configServer2.before(configurationsMessage2, TimeUnit.SECONDS, -1, false); String[] urls = new String[]{"localhost:"+configServer1.getPort(),"localhost:"+configServer2.getPort()}; + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } cache = new ElastiCacheMemcachedCache( new ElastiCacheCacheConfigBuilder() @@ -216,12 +221,12 @@ private void testHashAlgorithm(HashAlgorithm algo) { e.printStackTrace(); } - for(int i =0;i<100;i++) { + for(int i =0;i<10;i++) { testCaching(cache); } assertTrue(memcached1.getDaemon().getCache().getCurrentItems()>=1); - for(int i =0;i<100;i++) { + for(int i =0;i<10;i++) { testCaching(cache); } try { @@ -229,7 +234,7 @@ private void testHashAlgorithm(HashAlgorithm algo) { } catch (InterruptedException e) { e.printStackTrace(); } - for(int i =0;i<100;i++) { + for(int i =0;i<10;i++) { testCaching(cache); } assertTrue(memcached1.getDaemon().getCache().getCurrentItems()>1); diff --git a/src/test/java/org/greencheek/caching/herdcache/memcached/TestMultipleHostsElastiCacheMemcachedCaching.java b/src/test/java/org/greencheek/caching/herdcache/memcached/TestMultipleHostsElastiCacheMemcachedCaching.java index e097ecc..824190b 100644 --- a/src/test/java/org/greencheek/caching/herdcache/memcached/TestMultipleHostsElastiCacheMemcachedCaching.java +++ b/src/test/java/org/greencheek/caching/herdcache/memcached/TestMultipleHostsElastiCacheMemcachedCaching.java @@ -140,7 +140,7 @@ private void testStaleCaching(CacheWithExpiry cache) { Map> cacheWrites = new HashMap<>(200); - for(int i=0;i<200;i++) { + for(int i=0;i<50;i++) { final String uuidKey = UUID.randomUUID().toString(); cacheWrites.put(uuidKey, cache.apply(uuidKey, () -> { return uuidKey; diff --git a/src/test/java/org/greencheek/caching/herdcache/memcached/TestMultipleHostsWithNonCachingConfigElastiCacheMemcachedCaching.java b/src/test/java/org/greencheek/caching/herdcache/memcached/TestMultipleHostsWithNonCachingConfigElastiCacheMemcachedCaching.java index 2d6f62c..305dcd5 100644 --- a/src/test/java/org/greencheek/caching/herdcache/memcached/TestMultipleHostsWithNonCachingConfigElastiCacheMemcachedCaching.java +++ b/src/test/java/org/greencheek/caching/herdcache/memcached/TestMultipleHostsWithNonCachingConfigElastiCacheMemcachedCaching.java @@ -165,7 +165,7 @@ private void testStaleCaching(CacheWithExpiry cache) { Map> cacheWrites = new HashMap<>(100); - for(int i=0;i<100;i++) { + for(int i=0;i<20;i++) { final String uuidKey = UUID.randomUUID().toString(); cacheWrites.put(uuidKey, cache.apply(uuidKey, () -> { return uuidKey; diff --git a/src/test/java/org/greencheek/caching/herdcache/memcached/TestNoHostsElastiCacheMemcachedCaching.java b/src/test/java/org/greencheek/caching/herdcache/memcached/TestNoHostsElastiCacheMemcachedCaching.java index 8f74267..a0363d6 100644 --- a/src/test/java/org/greencheek/caching/herdcache/memcached/TestNoHostsElastiCacheMemcachedCaching.java +++ b/src/test/java/org/greencheek/caching/herdcache/memcached/TestNoHostsElastiCacheMemcachedCaching.java @@ -228,7 +228,7 @@ private void testNoCaching(CacheWithExpiry cache) { Map> cacheWrites = new HashMap<>(200); - for(int i=0;i<200;i++) { + for(int i=0;i<20;i++) { final String uuidKey = UUID.randomUUID().toString(); cacheWrites.put(uuidKey, cache.apply(uuidKey, () -> { return uuidKey;