[
https://issues.apache.org/jira/browse/FLINK-40974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Martijn Visser updated FLINK-40974:
-----------------------------------
Description:
Since FLINK-36336, {{JavaProgramTestBase#testJobWithObjectReuse}} enables
object reuse on the {{TestStreamEnvironment}} from {{MiniClusterExtension}},
but test programs call
{{StreamExecutionEnvironment.getExecutionEnvironment()}}, which builds a new
environment from the context factory without that setting. So both variants run
without object reuse, in {{JavaProgramTestBaseJUnit4}} as well. On top of that,
{{HadoopIOFormatsITCase.testJobWithObjectReuse}} has called
{{super.testJobWithoutObjectReuse()}} since FLINK-29050.
We should register the configured environment as context in both test bases,
let {{TestStreamEnvironment#setAsContext()}} carry object reuse over to the
environments it creates, and fix the {{HadoopIOFormatsITCase}} override.
was:
{{HadoopIOFormatsITCase.testJobWithObjectReuse}} calls
{{super.testJobWithoutObjectReuse()}}
(HadoopIOFormatsITCase.java:86-87), so the object reuse variant from
{{JavaProgramTestBase}} never
runs for this class. It came in with the JUnit 5 migration in FLINK-29050
(92eef24d4cc). The
override should call {{super.testJobWithObjectReuse()}}.
> JavaProgramTestBase runs its object reuse variant without object reuse
> ----------------------------------------------------------------------
>
> Key: FLINK-40974
> URL: https://issues.apache.org/jira/browse/FLINK-40974
> Project: Flink
> Issue Type: Bug
> Components: Formats (JSON, Avro, Parquet, ORC, SequenceFile), Tests
> Reporter: Martijn Visser
> Assignee: Martijn Visser
> Priority: Minor
>
> Since FLINK-36336, {{JavaProgramTestBase#testJobWithObjectReuse}} enables
> object reuse on the {{TestStreamEnvironment}} from {{MiniClusterExtension}},
> but test programs call
> {{StreamExecutionEnvironment.getExecutionEnvironment()}}, which builds a new
> environment from the context factory without that setting. So both variants
> run without object reuse, in {{JavaProgramTestBaseJUnit4}} as well. On top of
> that, {{HadoopIOFormatsITCase.testJobWithObjectReuse}} has called
> {{super.testJobWithoutObjectReuse()}} since FLINK-29050.
> We should register the configured environment as context in both test bases,
> let {{TestStreamEnvironment#setAsContext()}} carry object reuse over to the
> environments it creates, and fix the {{HadoopIOFormatsITCase}} override.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)