You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "MartijnVisser (via GitHub)" <gi...@apache.org> on 2026/10/13 20:16:08 UTC
[PR] [FLINK-40988][tests] Bump JUnit to 5.14.4 [flink]
MartijnVisser opened a new pull request, #29476:
URL: https://github.com/apache/flink/pull/29476
## What is the purpose of the change
Bump JUnit from 5.11.4 to 5.14.4, the latest 5.x release (6.x requires Java 17). This makes `@ParameterizedClass` available for new tests.
## Brief change log
- Make private JUnit lifecycle methods in flink-runtime tests package-private
- Bump `junit5.version` to 5.14.4 and implement the new `ExtensionContext` methods in `JUnit5TestEnvironment`
## Verifying this change
This change is already covered by existing tests, such as the migration ITCases. On JDK 17, a dry run of the whole reactor finds the same tests on 5.11.4 and 5.14.4, and a sample of test classes across flink-core, flink-runtime, the planner, the SQL gateway and flink-tests gives identical results on both. Regenerating the 2.3 snapshots of `StatefulJobWBroadcastStateMigrationITCase` with `MigrationTestsSnapshotGenerator` also works on both. I haven't run flink-yarn-tests or the other JDKs locally.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): yes
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
- The serializers: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (please specify the tool below)
Generated-by: Claude Code (Claude Opus 5.5)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-40988][tests] Bump JUnit to 5.14.4 [flink]
Posted by "MartijnVisser (via GitHub) via issues" <is...@flink.apache.org>.
MartijnVisser commented on PR #29476:
URL: https://github.com/apache/flink/pull/29476#issuecomment-7157273172
Thanks, the stub store now closes `AutoCloseable` values too, with a test. I took the `MiniClusterExtension` change into this PR as its own commit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-40988][tests] Bump JUnit to 5.14.4 [flink]
Posted by "MartijnVisser (via GitHub) via issues" <is...@flink.apache.org>.
MartijnVisser merged PR #29476:
URL: https://github.com/apache/flink/pull/29476
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-40988][tests] Bump JUnit to 5.14.4 [flink]
Posted by "MartijnVisser (via GitHub) via issues" <is...@flink.apache.org>.
MartijnVisser commented on code in PR #29476:
URL: https://github.com/apache/flink/pull/29476#discussion_r4720805518
##########
flink-core-api/src/test/java/org/apache/flink/configuration/MemorySizePrettyPrintingTest.java:
##########
@@ -19,20 +19,19 @@
package org.apache.flink.configuration;
import org.apache.flink.configuration.MemorySize.MemoryUnit;
-import org.apache.flink.testutils.junit.extensions.parameterized.Parameter;
-import org.apache.flink.testutils.junit.extensions.parameterized.ParameterizedTestExtension;
-import org.apache.flink.testutils.junit.extensions.parameterized.Parameters;
-import org.junit.jupiter.api.TestTemplate;
-import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.Parameter;
+import org.junit.jupiter.params.ParameterizedClass;
+import org.junit.jupiter.params.provider.MethodSource;
import static org.assertj.core.api.Assertions.assertThat;
/** Tests for {@link MemorySize#toString()}. */
-@ExtendWith(ParameterizedTestExtension.class)
Review Comment:
Not yet, about 295 test files still use it. I'd migrate those in follow-ups, then remove it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-40988][tests] Bump JUnit to 5.14.4 [flink]
Posted by "snuyanzin (via GitHub) via issues" <is...@flink.apache.org>.
snuyanzin commented on PR #29476:
URL: https://github.com/apache/flink/pull/29476#issuecomment-7220918878
also any reason we don't bump in archetype?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-40988][tests] Bump JUnit to 5.14.4 [flink]
Posted by "SEPURI-SAI-KRISHNA (via GitHub)" <gi...@apache.org>.
SEPURI-SAI-KRISHNA commented on PR #29476:
URL: https://github.com/apache/flink/pull/29476#issuecomment-6174381935
Had a look while it is in draft. One suggestion, one minor note.
`JUnit5TestEnvironment` line 505: the stub store's `close()` only closes `CloseableResource`, and there is no other handling in the file. The real store also closes `AutoCloseable`, unless `junit.jupiter.extensions.store.close.autocloseable.enabled` is false, and `CloseableResource` is deprecated since 5.13 in favour of extending `AutoCloseable` directly. Nothing leaks today: of the extensions these tests register, only `ParameterizedTestExtension` uses the store, and it keeps parameter values and `Field` objects. Still worth handling both while the file is being updated for 5.14.
Minor, separate from this PR: `MiniClusterExtension` line 307 implements `ExtensionContext.Store.CloseableResource`, which this bump turns into deprecated API.
On not having run flink-yarn-tests: for the private lifecycle part at least, a scan of every Java file at master 371ba17 finds 17 such methods across exactly the 8 files you changed, so flink-runtime is the whole of it. `junit-bom` is also driven by
`junit5.version` and no pom declares a `junit-platform` artifact or its own platform property, so jupiter, vintage and the platform jars they pull in all follow the one bump.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-40988][tests] Bump JUnit to 5.14.4 [flink]
Posted by "MartijnVisser (via GitHub) via issues" <is...@flink.apache.org>.
MartijnVisser commented on PR #29476:
URL: https://github.com/apache/flink/pull/29476#issuecomment-7221328787
> can we ensure that amount of tests before commit and after is same?
Yes. Azure 82177 runs the same test classes and counts as master 82172. Locally on JDK 17 and 21 I also compared method, arguments and result per invocation for the 11 pilot classes, and they are identical. The only change is that BitSetTest now shows `byte size = 1000` instead of `1,000`. None of these classes mixed `@Test` and `@TestTemplate`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-40988][tests] Bump JUnit to 5.14.4 [flink]
Posted by "snuyanzin (via GitHub) via issues" <is...@flink.apache.org>.
snuyanzin commented on code in PR #29476:
URL: https://github.com/apache/flink/pull/29476#discussion_r4717215533
##########
flink-core-api/src/test/java/org/apache/flink/configuration/MemorySizePrettyPrintingTest.java:
##########
@@ -19,20 +19,19 @@
package org.apache.flink.configuration;
import org.apache.flink.configuration.MemorySize.MemoryUnit;
-import org.apache.flink.testutils.junit.extensions.parameterized.Parameter;
-import org.apache.flink.testutils.junit.extensions.parameterized.ParameterizedTestExtension;
-import org.apache.flink.testutils.junit.extensions.parameterized.Parameters;
-import org.junit.jupiter.api.TestTemplate;
-import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.Parameter;
+import org.junit.jupiter.params.ParameterizedClass;
+import org.junit.jupiter.params.provider.MethodSource;
import static org.assertj.core.api.Assertions.assertThat;
/** Tests for {@link MemorySize#toString()}. */
-@ExtendWith(ParameterizedTestExtension.class)
Review Comment:
do we still need this extension?
can we drop it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-40988][tests] Bump JUnit to 5.14.4 [flink]
Posted by "MartijnVisser (via GitHub) via issues" <is...@flink.apache.org>.
MartijnVisser commented on PR #29476:
URL: https://github.com/apache/flink/pull/29476#issuecomment-7213622390
You can find a run of this in my GHA CI https://github.com/MartijnVisser/flink/actions/runs/45907739978
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-40988][tests] Bump JUnit to 5.14.4 [flink]
Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #29476:
URL: https://github.com/apache/flink/pull/29476#issuecomment-6154671213
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "33dded87b96930733474412700a031b97ee20b10",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "33dded87b96930733474412700a031b97ee20b10",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 33dded87b96930733474412700a031b97ee20b10 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-40988][tests] Bump JUnit to 5.14.4 [flink]
Posted by "snuyanzin (via GitHub) via issues" <is...@flink.apache.org>.
snuyanzin commented on PR #29476:
URL: https://github.com/apache/flink/pull/29476#issuecomment-7213686901
AFAIR in the past there was a problem with missing or duplicating tests while moving between `@Test` and `@TestTemplate`
can we ensure that amount of tests before commit and after is same?
Ideally also check for test names + args
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-40988][tests] Bump JUnit to 5.14.4 [flink]
Posted by "MartijnVisser (via GitHub) via issues" <is...@flink.apache.org>.
MartijnVisser commented on PR #29476:
URL: https://github.com/apache/flink/pull/29476#issuecomment-7221329129
> also any reason we don't bump in archetype?
Good catch, the walkthrough archetype now uses `@junit5.version@`, like log4j.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org