From ac6dc7dce62677f1553ce0427e78b09476ee3439 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Wed, 17 Jul 2024 16:25:32 +0200 Subject: [PATCH] added failing and success expire test Signed-off-by: munishchouhan --- .../counter/impl/RedisCounterProviderTest.groovy | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/test/groovy/io/seqera/wave/service/counter/impl/RedisCounterProviderTest.groovy b/src/test/groovy/io/seqera/wave/service/counter/impl/RedisCounterProviderTest.groovy index e95c5d776..cbbce2c72 100644 --- a/src/test/groovy/io/seqera/wave/service/counter/impl/RedisCounterProviderTest.groovy +++ b/src/test/groovy/io/seqera/wave/service/counter/impl/RedisCounterProviderTest.groovy @@ -84,7 +84,20 @@ class RedisCounterProviderTest extends Specification implements RedisTestContain ['pulls/o/abc.com.au/d/2024-05-30': 1] } - def 'should expire the hash'(){ + def 'failing: should expire the hash'(){ + when: + redisCounterProvider.inc('metrics/v1', 'pulls/o/abc.com.au/d/2024-07-14', 1) + sleep(500) + redisCounterProvider.inc('metrics/v1', 'pulls/o/abc.com.au/d/2024-07-15', 1) + sleep(500) + then:'this value should be one, because foo should be expired' + redisCounterProvider.get('metrics/v1', 'pulls/o/abc.com.au/d/2024-07-14') == null + sleep(500) + and: + redisCounterProvider.get('metrics/v1', 'pulls/o/abc.com.au/d/2024-07-15') == null + } + + def 'successful: should expire the hash'(){ when: redisCounterProvider.inc('metrics/v1', 'pulls/o/abc.com.au/d/2024-07-14', 1) sleep(500)