From ce60835a8d43d067f106a4c025e24afe11029810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Mon, 2 Mar 2026 12:06:01 +0100 Subject: [PATCH 1/4] fix: flaky MySQLSchema E2E test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- sample-operators/mysql-schema/pom.xml | 5 +++++ .../dependent/SchemaDependentResource.java | 1 + .../operator/sample/MySQLSchemaOperatorE2E.java | 16 ++++++---------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/sample-operators/mysql-schema/pom.xml b/sample-operators/mysql-schema/pom.xml index ea4f50256e..2055a9933d 100644 --- a/sample-operators/mysql-schema/pom.xml +++ b/sample-operators/mysql-schema/pom.xml @@ -90,6 +90,11 @@ operator-framework-junit test + + org.assertj + assertj-core + test + diff --git a/sample-operators/mysql-schema/src/main/java/io/javaoperatorsdk/operator/sample/dependent/SchemaDependentResource.java b/sample-operators/mysql-schema/src/main/java/io/javaoperatorsdk/operator/sample/dependent/SchemaDependentResource.java index 6400d312c7..a34cab5384 100644 --- a/sample-operators/mysql-schema/src/main/java/io/javaoperatorsdk/operator/sample/dependent/SchemaDependentResource.java +++ b/sample-operators/mysql-schema/src/main/java/io/javaoperatorsdk/operator/sample/dependent/SchemaDependentResource.java @@ -110,6 +110,7 @@ private Connection getConnection() throws SQLException { @Override public void delete(MySQLSchema primary, Context context) { + log.debug("Deleting schema"); try (Connection connection = getConnection()) { var userName = primary.getStatus() != null ? primary.getStatus().getUserName() : null; SchemaService.deleteSchemaAndRelatedUser( diff --git a/sample-operators/mysql-schema/src/test/java/io/javaoperatorsdk/operator/sample/MySQLSchemaOperatorE2E.java b/sample-operators/mysql-schema/src/test/java/io/javaoperatorsdk/operator/sample/MySQLSchemaOperatorE2E.java index 129b502ed8..80d07333f6 100644 --- a/sample-operators/mysql-schema/src/test/java/io/javaoperatorsdk/operator/sample/MySQLSchemaOperatorE2E.java +++ b/sample-operators/mysql-schema/src/test/java/io/javaoperatorsdk/operator/sample/MySQLSchemaOperatorE2E.java @@ -36,12 +36,8 @@ import io.javaoperatorsdk.operator.sample.dependent.SchemaDependentResource; import static java.util.concurrent.TimeUnit.MINUTES; +import static org.assertj.core.api.Assertions.assertThat; import static org.awaitility.Awaitility.await; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.notNullValue; -import static org.hamcrest.Matchers.nullValue; class MySQLSchemaOperatorE2E { @@ -114,10 +110,10 @@ void test() { .inNamespace(operator.getNamespace()) .withName(testSchema.getMetadata().getName()) .get(); - assertThat(updatedSchema.getStatus(), is(notNullValue())); - assertThat(updatedSchema.getStatus().getStatus(), equalTo("CREATED")); - assertThat(updatedSchema.getStatus().getSecretName(), is(notNullValue())); - assertThat(updatedSchema.getStatus().getUserName(), is(notNullValue())); + assertThat(updatedSchema.getStatus()).isNotNull(); + assertThat(updatedSchema.getStatus().getStatus()).isEqualTo("CREATED"); + assertThat(updatedSchema.getStatus().getSecretName()).isNotNull(); + assertThat(updatedSchema.getStatus().getUserName()).isNotNull(); }); client @@ -137,7 +133,7 @@ void test() { .inNamespace(operator.getNamespace()) .withName(testSchema.getMetadata().getName()) .get(); - assertThat(updatedSchema, is(nullValue())); + assertThat(updatedSchema).isNull(); }); } } From d4aadd09ec804b7d12c7fc6cd3cbd710f7d61e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Mon, 2 Mar 2026 13:00:36 +0100 Subject: [PATCH 2/4] log fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pom.xml b/pom.xml index 9e52d87be1..412a7aab76 100644 --- a/pom.xml +++ b/pom.xml @@ -549,6 +549,10 @@ **/*Test.java **/*IT.java + + true + true + From 2c6f41cf071fb9492054a78455ef0aea35aa1337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Mon, 2 Mar 2026 13:01:48 +0100 Subject: [PATCH 3/4] logging improve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- pom.xml | 4 ---- .../mysql-schema/src/main/resources/log4j2.xml | 7 +++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 412a7aab76..9e52d87be1 100644 --- a/pom.xml +++ b/pom.xml @@ -549,10 +549,6 @@ **/*Test.java **/*IT.java - - true - true - diff --git a/sample-operators/mysql-schema/src/main/resources/log4j2.xml b/sample-operators/mysql-schema/src/main/resources/log4j2.xml index 2979258355..b13b48c93d 100644 --- a/sample-operators/mysql-schema/src/main/resources/log4j2.xml +++ b/sample-operators/mysql-schema/src/main/resources/log4j2.xml @@ -16,14 +16,17 @@ limitations under the License. --> - + - + + + + From 22d7bd652266ef0a9cb6874fec57cff8563135f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Mon, 2 Mar 2026 17:36:05 +0100 Subject: [PATCH 4/4] wip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- sample-operators/mysql-schema/src/main/resources/log4j2.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-operators/mysql-schema/src/main/resources/log4j2.xml b/sample-operators/mysql-schema/src/main/resources/log4j2.xml index b13b48c93d..593f120e0b 100644 --- a/sample-operators/mysql-schema/src/main/resources/log4j2.xml +++ b/sample-operators/mysql-schema/src/main/resources/log4j2.xml @@ -16,7 +16,7 @@ limitations under the License. --> - +