/*
* ============LICENSE_START========================================================
- * Copyright (C) 2022-2025 Nordix Foundation
+ * Copyright (C) 2022-2025 OpenInfra Foundation Europe. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
def 'Time to Live Verify for Module Sync Semaphore'() {
- when: 'the key is inserted with a TTL of 1 second (Hazelcast TTL resolution is seconds!)'
- moduleSyncStartedOnCmHandles.put('testKeyModuleSync', 'toBeExpired' as Object, 1, TimeUnit.SECONDS)
- then: 'the entry is present in the map'
- assert moduleSyncStartedOnCmHandles.get('testKeyModuleSync') != null
- and: 'the entry expires'
- new PollingConditions().within(10) {
+ when: 'the key is inserted with a TTL'
+ moduleSyncStartedOnCmHandles.put('testKeyModuleSync', 'toBeExpired' as Object, 100, TimeUnit.MILLISECONDS)
+ then: 'the entry expires within a second'
+ new PollingConditions().within(1) {
assert moduleSyncStartedOnCmHandles.get('testKeyModuleSync') == null
}
}
def 'Time to Live Verify for Data Sync Semaphore'() {
- when: 'the key is inserted with a TTL of 1 second'
- dataSyncSemaphores.put('testKeyDataSync', Boolean.TRUE, 1, TimeUnit.SECONDS)
- then: 'the entry is present in the map'
- assert dataSyncSemaphores.get('testKeyDataSync') != null
- and: 'the entry expires'
- new PollingConditions().within(10) {
+ when: 'the key is inserted with a TTL'
+ dataSyncSemaphores.put('testKeyDataSync', Boolean.TRUE, 100, TimeUnit.MILLISECONDS)
+ then: 'the entry expires within a second'
+ new PollingConditions().within(1) {
assert dataSyncSemaphores.get('testKeyDataSync') == null
}
}