Make some test timeouts (await) configurable (#2525)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Test the remote entity events.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Entity Id Events
|
||||
*/
|
||||
|
||||
@@ -19,7 +19,7 @@ import org.eclipse.hawkbit.repository.event.remote.AbstractRemoteEventTest;
|
||||
|
||||
/**
|
||||
* Test the remote entity events.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Entity Events
|
||||
*/
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Test the remote entity events.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Test ActionCreatedEvent and ActionUpdatedEvent
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Test the remote entity events.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Test DistributionSetCreatedEvent
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Test the remote entity events.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Test DistributionSetTagCreatedEvent and DistributionSetTagUpdateEvent
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Test the remote entity events.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Test DistributionSetUpdateEvent
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Test the remote entity events.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Test RolloutUpdatedEvent
|
||||
*/
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Test the remote entity events.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Test RolloutGroupCreatedEvent and RolloutGroupUpdatedEvent
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Test the remote entity events.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Test SoftwareModuleCreatedEvent, SoftwareModuleUpdatedEvent
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Test the remote entity events.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Test TargetCreatedEvent, TargetUpdatedEvent and CancelTargetAssignmentEvent
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Test the remote entity events.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Test TargetTagCreatedEvent and TargetTagUpdateEvent
|
||||
*/
|
||||
|
||||
@@ -43,7 +43,7 @@ import org.springframework.test.context.TestPropertySource;
|
||||
/**
|
||||
* Test class testing the invalidation of a {@link DistributionSet} while the
|
||||
* handle rollouts is ongoing.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Concurrent Distribution Set invalidation
|
||||
*/
|
||||
@@ -67,12 +67,14 @@ class ConcurrentDistributionSetInvalidationTest extends AbstractJpaIntegrationTe
|
||||
return 0;
|
||||
}, tenant)).start();
|
||||
|
||||
// wait until at least one RolloutGroup is created, as this means that
|
||||
// the thread has started and has acquired the lock
|
||||
Awaitility.await().atMost(Duration.ofSeconds(5))
|
||||
// wait until at least one RolloutGroup is created, as this means that the thread has started and has acquired the lock
|
||||
Awaitility.await()
|
||||
.pollInterval(Duration.ofMillis(100))
|
||||
.until(() -> tenantAware.runAsTenant(tenant, () -> systemSecurityContext
|
||||
.runAsSystem(() -> rolloutGroupManagement.findByRollout(rollout.getId(), PAGE).getSize() > 0)));
|
||||
.atMost(Duration.ofSeconds(5))
|
||||
.until(() -> tenantAware.runAsTenant(
|
||||
tenant,
|
||||
() -> systemSecurityContext.runAsSystem(
|
||||
() -> rolloutGroupManagement.findByRollout(rollout.getId(), PAGE).getSize() > 0)));
|
||||
|
||||
final DistributionSetInvalidation distributionSetInvalidation = new DistributionSetInvalidation(
|
||||
Collections.singletonList(distributionSet.getId()), CancelationType.SOFT, true);
|
||||
|
||||
@@ -45,7 +45,7 @@ import org.springframework.data.domain.Slice;
|
||||
|
||||
/**
|
||||
* Test class for {@link AutoAssignChecker}.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Auto assign checker
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* Test class for {@link AutoActionCleanup}.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Action cleanup handler
|
||||
*/
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.springframework.integration.support.locks.LockRegistry;
|
||||
|
||||
/**
|
||||
* Test class for {@link AutoCleanupScheduler}.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Auto cleanup scheduler
|
||||
*/
|
||||
|
||||
@@ -48,7 +48,10 @@ class ActionTest extends AbstractJpaIntegrationTest {
|
||||
assertThat(timeforcedAction.isForcedOrTimeForced()).isFalse();
|
||||
|
||||
// wait until timeforce time is hit
|
||||
Awaitility.await().atMost(Duration.ofSeconds(2)).pollInterval(Duration.ofMillis(100)).until(timeforcedAction::isForcedOrTimeForced);
|
||||
Awaitility.await()
|
||||
.pollInterval(Duration.ofMillis(100))
|
||||
.atMost(Duration.ofSeconds(2))
|
||||
.until(timeforcedAction::isForcedOrTimeForced);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -54,7 +54,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Test class for {@link ArtifactManagement}.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Artifact Management
|
||||
*/
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.junit.jupiter.params.provider.MethodSource;
|
||||
/**
|
||||
* Test class testing the functionality of triggering a deployment of
|
||||
* {@link DistributionSet}s to {@link Target}s with AutoConfirmation active.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Confirmation Management
|
||||
*/
|
||||
|
||||
@@ -93,7 +93,7 @@ import org.springframework.data.domain.Sort.Direction;
|
||||
|
||||
/**
|
||||
* Test class testing the functionality of triggering a deployment of {@link DistributionSet}s to {@link Target}s.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Deployment Management
|
||||
*/
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.springframework.data.repository.query.Param;
|
||||
/**
|
||||
* Test class testing the functionality of invalidating a
|
||||
* {@link DistributionSet}
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Distribution set invalidation management
|
||||
*/
|
||||
|
||||
@@ -69,7 +69,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* {@link DistributionSetManagement} tests.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: DistributionSet Management
|
||||
*/
|
||||
|
||||
@@ -41,7 +41,7 @@ import org.springframework.data.domain.Pageable;
|
||||
|
||||
/**
|
||||
* {@link DistributionSetTagManagement} tests.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: DistributionSet Tag Management
|
||||
*/
|
||||
|
||||
@@ -44,7 +44,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* {@link DistributionSetManagement} tests.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: DistributionSet Management
|
||||
*/
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.springframework.test.context.TestPropertySource;
|
||||
|
||||
/**
|
||||
* Junit tests for RolloutManagement.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Rollout Management (Flow)
|
||||
*/
|
||||
|
||||
@@ -99,7 +99,7 @@ import org.springframework.data.domain.Sort.Direction;
|
||||
|
||||
/**
|
||||
* Junit tests for RolloutManagement.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Rollout Management
|
||||
*/
|
||||
@@ -2497,7 +2497,9 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
}
|
||||
|
||||
private void awaitRunningState(final Long myRolloutId) {
|
||||
Awaitility.await().atMost(Duration.ofSeconds(10)).pollInterval(Duration.ofMillis(500)).with()
|
||||
Awaitility.await()
|
||||
.pollInterval(Duration.ofMillis(500))
|
||||
.atMost(Duration.ofSeconds(10))
|
||||
.until(() -> SecurityContextSwitch
|
||||
.runAsPrivileged(
|
||||
() -> rolloutManagement.get(myRolloutId).orElseThrow(NoSuchElementException::new))
|
||||
|
||||
@@ -56,7 +56,7 @@ import org.springframework.data.domain.Slice;
|
||||
|
||||
/**
|
||||
* Test class for {@link TargetFilterQueryManagement}.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Target Filter Query Management
|
||||
*/
|
||||
|
||||
@@ -43,7 +43,7 @@ import org.springframework.data.domain.Pageable;
|
||||
|
||||
/**
|
||||
* Test class for {@link TargetTagManagement}.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Target Tag Management
|
||||
*/
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Test the entity listener interceptor.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Entity Listener Interceptor
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.springframework.data.domain.Slice;
|
||||
* Multi-Tenancy tests which testing the CRUD operations of entities that all
|
||||
* CRUD-Operations are tenant aware and cannot access or delete entities not
|
||||
* belonging to the current tenant.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Feature: Component Tests - Repository<br/>
|
||||
* Story: Multi Tenancy
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user