Skip to content

Commit

Permalink
added failing and success expire test
Browse files Browse the repository at this point in the history
Signed-off-by: munishchouhan <[email protected]>
  • Loading branch information
munishchouhan committed Jul 17, 2024
1 parent 636a90f commit ac6dc7d
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ac6dc7d

Please sign in to comment.