Skip to content

fix: formatter plugin update and related issues #1261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,15 @@ void reScheduleOnlyIfNotExecutedEventsReceivedMeanwhile() throws InterruptedExce
var testDelay = 10000L;
doAnswer(new AnswersWithDelay(FAKE_CONTROLLER_EXECUTION_DURATION,
new Returns(PostExecutionControl.defaultDispatch().withReSchedule(testDelay))))
.when(reconciliationDispatcherMock).handleExecution(any());
.when(reconciliationDispatcherMock).handleExecution(any());
var resourceId = new ResourceID("test1", "default");
eventProcessor.handleEvent(prepareCREvent(resourceId));
Thread.sleep(FAKE_CONTROLLER_EXECUTION_DURATION / 3);
eventProcessor.handleEvent(prepareCREvent(resourceId));

verify(retryTimerEventSourceMock,
after((long) (FAKE_CONTROLLER_EXECUTION_DURATION * 1.5)).times(0))
.scheduleOnce(any(), eq(testDelay));
.scheduleOnce(any(), eq(testDelay));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ void setObservedGenerationForStatusIfNeeded() throws Exception {
executionScopeWithCREvent(observedGenResource));
assertThat(control.getUpdatedCustomResource().orElseGet(() -> fail("Missing optional"))
.getStatus().getObservedGeneration())
.isEqualTo(1L);
.isEqualTo(1L);
}

@Test
Expand All @@ -462,7 +462,7 @@ void updatesObservedGenerationOnNoUpdateUpdateControl() throws Exception {
executionScopeWithCREvent(observedGenResource));
assertThat(control.getUpdatedCustomResource().orElseGet(() -> fail("Missing optional"))
.getStatus().getObservedGeneration())
.isEqualTo(1L);
.isEqualTo(1L);
}

@Test
Expand All @@ -483,7 +483,7 @@ void updateObservedGenerationOnCustomResourceUpdate() throws Exception {
executionScopeWithCREvent(observedGenResource));
assertThat(control.getUpdatedCustomResource().orElseGet(() -> fail("Missing optional"))
.getStatus().getObservedGeneration())
.isEqualTo(1L);
.isEqualTo(1L);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void addNewAndRemoveOldNamespaceTest() {
await().pollDelay(Duration.ofMillis(200)).untilAsserted(
() -> assertThat(
reconciler.numberOfResourceReconciliations(resourceInAdditionalTestNamespace))
.isZero());
.isZero());

// adding additional namespace
RegisteredController registeredController =
Expand All @@ -56,7 +56,7 @@ void addNewAndRemoveOldNamespaceTest() {
await().untilAsserted(
() -> assertThat(
reconciler.numberOfResourceReconciliations(resourceInAdditionalTestNamespace))
.isEqualTo(2));
.isEqualTo(2));

// removing a namespace
registeredController.changeNamespaces(Set.of(ADDITIONAL_TEST_NAMESPACE));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void updateEventNotReceivedAfterCreateOrUpdate() {
assertThat(
((CreateUpdateEventFilterTestReconciler) operator.getFirstReconciler())
.getNumberOfExecutions())
.isEqualTo(1); // this should be 1 usually but sometimes event is received
.isEqualTo(1); // this should be 1 usually but sometimes event is received
// faster than added resource added to the cache


Expand All @@ -70,8 +70,8 @@ void updateEventNotReceivedAfterCreateOrUpdate() {
assertThat(
((CreateUpdateEventFilterTestReconciler) operator.getFirstReconciler())
.getNumberOfExecutions())
// same as for previous assert (usually this should be 2)
.isEqualTo(2);
// same as for previous assert (usually this should be 2)
.isEqualTo(2);
}

private CreateUpdateEventFilterTestCustomResource prepareTestResource() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void doesCustomFiltering() throws InterruptedException {

assertThat(
((CustomFilteringTestReconciler) operator.getReconcilers().get(0)).getNumberOfExecutions())
.isEqualTo(1);
.isEqualTo(1);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void reconcileNotTriggeredWithDependentResourceCreateOrUpdate() {
.until(
() -> ((DependentOperationEventFilterCustomResourceTestReconciler) operator
.getFirstReconciler())
.getNumberOfExecutions() == 1);
.getNumberOfExecutions() == 1);
assertThat(operator.get(ConfigMap.class, TEST).getData())
.containsEntry(ConfigMapDependentResource.KEY, SPEC_VAL_1);

Expand All @@ -48,7 +48,7 @@ void reconcileNotTriggeredWithDependentResourceCreateOrUpdate() {
.until(
() -> ((DependentOperationEventFilterCustomResourceTestReconciler) operator
.getFirstReconciler())
.getNumberOfExecutions() == 2);
.getNumberOfExecutions() == 2);
assertThat(operator.get(ConfigMap.class, TEST).getData())
.containsEntry(ConfigMapDependentResource.KEY, SPEC_VAL_2);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void deletingSecondaryResource() {
waitForCRStatusValue(MISSING_CONFIG_MAP);
assertThat(((InformerEventSourceTestCustomReconciler) operator.getReconcilers().get(0))
.getNumberOfExecutions())
.isEqualTo(3);
.isEqualTo(3);
}

private ConfigMap relatedConfigMap(String relatedResourceAnnotation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ void testReconciliationOfNonCustomResourceAndStatusUpdate() {
assertThat(d.getStatus().getReadyReplicas()).isGreaterThanOrEqualTo(1);
assertThat(
d.getStatus().getConditions().stream().filter(c -> c.getMessage().equals(STATUS_MESSAGE))
.count()).isEqualTo(1);
.count())
.isEqualTo(1);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void invalidEventsDoesNotBreakEventHandling() {
operator
.get(MultiVersionCRDTestCustomResource2.class, CR_V2_NAME)
.getStatus())
.isNull();
.isNull();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void retryFailedExecution() {
.untilAsserted(() -> {
assertThat(
TestUtils.getNumberOfExecutions(operator))
.isEqualTo(NUMBER_FAILED_EXECUTIONS + 1);
.isEqualTo(NUMBER_FAILED_EXECUTIONS + 1);

RetryTestCustomResource finalResource =
operator.get(RetryTestCustomResource.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void dependentResourceManagesDeployment() {
awaitForDeploymentReadyReplicas(1);
assertThat(
((StandaloneDependentTestReconciler) operator.getFirstReconciler()).isErrorOccurred())
.isFalse();
.isFalse();
}

@Test
Expand All @@ -58,7 +58,7 @@ void executeUpdateForTestingCacheUpdateForGetResource() {
awaitForDeploymentReadyReplicas(2);
assertThat(
((StandaloneDependentTestReconciler) operator.getFirstReconciler()).isErrorOccurred())
.isFalse();
.isFalse();
}

void awaitForDeploymentReadyReplicas(int expectedReplicaCount) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void noOptimisticLockingDoneOnStatusUpdate() throws InterruptedException {
await().pollDelay(Duration.ofMillis(WAIT_TIME)).untilAsserted(() -> {
assertThat(
operator.getReconcilerOfType(StatusPatchLockingReconciler.class).getNumberOfExecutions())
.isEqualTo(1);
.isEqualTo(1);
var actual = operator.get(StatusPatchLockingCustomResource.class,
TEST_RESOURCE_NAME);
assertThat(actual
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void optimisticLockingDoneOnStatusUpdate() throws InterruptedException {
await().pollDelay(Duration.ofMillis(WAIT_TIME)).untilAsserted(() -> {
assertThat(
operator.getReconcilerOfType(StatusUpdateLockingReconciler.class).getNumberOfExecutions())
.isEqualTo(2);
.isEqualTo(2);
assertThat(operator.get(StatusUpdateLockingCustomResource.class, TEST_RESOURCE_NAME)
.getStatus().getValue()).isEqualTo(1);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void updatesSubResourceStatus() {
.getMetadata()
.getAnnotations()
.get(DoubleUpdateTestCustomReconciler.TEST_ANNOTATION))
.isNotNull();
.isNotNull();
}

void awaitStatusUpdated(String name) {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
<maven-install-plugin.version>2.5.2</maven-install-plugin.version>
<git-commit-id-maven-plugin.version>5.0.0</git-commit-id-maven-plugin.version>
<formatter-maven-plugin.version>2.18.0</formatter-maven-plugin.version>
<formatter-maven-plugin.version>2.19.0</formatter-maven-plugin.version>
<directory-maven-plugin.version>1.0</directory-maven-plugin.version>
<impsort-maven-plugin.version>1.7.0</impsort-maven-plugin.version>
</properties>
Expand Down