Improve JpaRolloutHandler logging (#1801)

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-08-02 16:17:01 +03:00
committed by GitHub
parent 0afd7e8036
commit 3002b50807
2 changed files with 37 additions and 4 deletions

View File

@@ -382,6 +382,36 @@ class RolloutManagementFlowTest extends AbstractJpaIntegrationTest {
assertGroup(dynamic2, true, RolloutGroupStatus.RUNNING, 4); // assign the target created when paused
}
@Test
@Description("Verifies a simple rollout flow")
void rollout0ThresholdFlow() {
final String rolloutName = "rollout-std-0threshold";
final int amountGroups = 5; // static only
final String targetPrefix = "controller-rollout-std-0threshold-";
final DistributionSet distributionSet = testdataFactory.createDistributionSet("dsFor" + rolloutName);
testdataFactory.createTargets(targetPrefix, 0, amountGroups * 3);
final Rollout rollout = testdataFactory.createRolloutByVariables(rolloutName, rolloutName, amountGroups,
"controllerid==" + targetPrefix + "*", distributionSet, "0", "25", false, false);
final List<RolloutGroup> groups = rolloutGroupManagement.findByRollout(
new OffsetBasedPageRequest(0, amountGroups + 10, Sort.by(Direction.ASC, "id")),
rollout.getId()).getContent();
// start rollout
rolloutManagement.start(rollout.getId());
// handleStartingRollout (no handleRunning called yet)
rolloutHandler.handleAll();
assertRollout(rollout, false, RolloutStatus.RUNNING, amountGroups, amountGroups * 3);
for (int step = 1; step <= amountGroups; step++) {
for (int i = 0; i < amountGroups; i++) {
assertGroup(groups.get(i), false, i < step ? RolloutGroupStatus.RUNNING : RolloutGroupStatus.SCHEDULED, 3);
}
// starting the next group
rolloutHandler.handleAll();
}
}
private void executeStaticWithoutOneTargetFromTheLastGroupAndHandleAll(
final List<RolloutGroup> groups,
final Rollout rollout, final int amountGroups) {