Make some test timeouts (await) configurable (#2525)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2025-07-02 12:45:26 +03:00
committed by GitHub
parent bdbc658ea9
commit 8c6d56f177
77 changed files with 188 additions and 211 deletions

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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);

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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);
}
/**

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -69,7 +69,7 @@ import org.springframework.beans.factory.annotation.Autowired;
/**
* {@link DistributionSetManagement} tests.
* <p/>
* <p/>
* Feature: Component Tests - Repository<br/>
* Story: DistributionSet Management
*/

View File

@@ -41,7 +41,7 @@ import org.springframework.data.domain.Pageable;
/**
* {@link DistributionSetTagManagement} tests.
* <p/>
* <p/>
* Feature: Component Tests - Repository<br/>
* Story: DistributionSet Tag Management
*/

View File

@@ -44,7 +44,7 @@ import org.junit.jupiter.api.Test;
/**
* {@link DistributionSetManagement} tests.
* <p/>
* <p/>
* Feature: Component Tests - Repository<br/>
* Story: DistributionSet Management
*/

View File

@@ -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)
*/

View File

@@ -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))

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/