Skip to content

[SPARK-58030][SQL][TESTS] Make FileDataSourceV2FallBackSuite robust to extra listener events#57097

Closed
HyukjinKwon wants to merge 1 commit into
apache:masterfrom
HyukjinKwon:DO-NOT-MERGE/deflake-master
Closed

[SPARK-58030][SQL][TESTS] Make FileDataSourceV2FallBackSuite robust to extra listener events#57097
HyukjinKwon wants to merge 1 commit into
apache:masterfrom
HyukjinKwon:DO-NOT-MERGE/deflake-master

Conversation

@HyukjinKwon

@HyukjinKwon HyukjinKwon commented Jul 7, 2026

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

Fixes a flaky failure in scheduled CI on master (build_maven_java21_macos26, sql#core - other tests).

FileDataSourceV2FallBackSuite "Fallback Parquet V2 to V1" asserted commands.length == 1 on a QueryExecutionListener. An extra eager collect callback on the analyzed UnresolvedDataSource can race onto the listener bus, making the count 2 and failing the test non-deterministically. Fixed by filtering the recorded events to the write "command" entry and asserting on that, instead of requiring the bus to contain exactly one event.

Why are the changes needed?

The flake intermittently reds scheduled builds without indicating a real product regression.

Does this PR introduce any user-facing change?

No. Test-only change.

How was this patch tested?

  • Passes locally (Tests: succeeded 5, failed 0, including "Fallback Parquet V2 to V1").
  • Fork CI (build_maven_java21_macos26, sql#core - other tests): ✅ PASShttps://github.com/HyukjinKwon/spark/actions/runs/28906196443
    Tests: succeeded 19657, failed 0 — "All tests passed", with "Fallback Parquet V2 to V1" running clean. (The run's overall status shows a failure only from an unrelated TransformWithStateAvroSuite state-store schema-evolution flake in the separate sql#core - slow tests shard, which shares no code path with this test-only change.)

JIRA: https://issues.apache.org/jira/browse/SPARK-58030

Related-but-not-fixed (documented for reviewers)

  • DynamicPartitionPruningHiveScanSuiteAEOff "broadcast a single key in a HashedRelation" (sql#hive - slow tests on the same workflow): an embedded-Derby internal ClassCastException (ReferencedColumnsDescriptorImplExecRowBuilder) in the DataNucleus metastore layer — Derby-internal state corruption under the slow macOS-26 JDK21 run, with no Spark product line to fix. It passed on this run, consistent with a non-deterministic flake. Not addressed here.

@HyukjinKwon HyukjinKwon force-pushed the DO-NOT-MERGE/deflake-master branch from 12fd8f8 to 6e5afb3 Compare July 8, 2026 01:40
@HyukjinKwon HyukjinKwon changed the title [DO-NOT-MERGE] Fix flaky FileDataSourceV2FallBackSuite listener race and SparkR Windows silent timeout [DO-NOT-MERGE] Fix flaky FileDataSourceV2FallBackSuite listener-event race Jul 8, 2026
…o extra listener events

The 'Fallback Parquet V2 to V1' test asserted that exactly one query
execution event landed on the listener bus (assert(commands.length == 1)).
An additional eager 'collect' callback on the analyzed UnresolvedDataSource
can race onto the bus, making the count 2 and failing the test
nondeterministically (seen on the JDK 21 macOS-26 Maven run).

Filter the recorded events to the write 'command' entry and assert on that,
rather than requiring the bus to contain exactly one event.
@HyukjinKwon HyukjinKwon force-pushed the DO-NOT-MERGE/deflake-master branch from 6e5afb3 to 867b691 Compare July 8, 2026 05:32
@HyukjinKwon HyukjinKwon changed the title [DO-NOT-MERGE] Fix flaky FileDataSourceV2FallBackSuite listener-event race [SPARK-58030][SQL][TESTS] Make FileDataSourceV2FallBackSuite robust to extra listener events Jul 8, 2026
@HyukjinKwon HyukjinKwon marked this pull request as ready for review July 8, 2026 05:32
HyukjinKwon added a commit that referenced this pull request Jul 8, 2026
… extra listener events

### What changes were proposed in this pull request?

Fixes a flaky failure in scheduled CI on `master` (`build_maven_java21_macos26`, `sql#core - other tests`).

`FileDataSourceV2FallBackSuite` "Fallback Parquet V2 to V1" asserted `commands.length == 1` on a `QueryExecutionListener`. An extra eager `collect` callback on the analyzed `UnresolvedDataSource` can race onto the listener bus, making the count `2` and failing the test non-deterministically. Fixed by filtering the recorded events to the write `"command"` entry and asserting on that, instead of requiring the bus to contain exactly one event.

### Why are the changes needed?

The flake intermittently reds scheduled builds without indicating a real product regression.

### Does this PR introduce _any_ user-facing change?

No. Test-only change.

### How was this patch tested?

- Passes locally (`Tests: succeeded 5, failed 0`, including "Fallback Parquet V2 to V1").
- Fork CI (`build_maven_java21_macos26`, `sql#core - other tests`): ✅ **PASS** — https://github.com/HyukjinKwon/spark/actions/runs/28906196443
  `Tests: succeeded 19657, failed 0` — "All tests passed", with "Fallback Parquet V2 to V1" running clean. (The run's overall status shows a failure only from an unrelated `TransformWithStateAvroSuite` state-store schema-evolution flake in the separate `sql#core - slow tests` shard, which shares no code path with this test-only change.)

JIRA: https://issues.apache.org/jira/browse/SPARK-58030

### Related-but-not-fixed (documented for reviewers)

- **`DynamicPartitionPruningHiveScanSuiteAEOff` "broadcast a single key in a HashedRelation"** (`sql#hive - slow tests` on the same workflow): an embedded-Derby internal `ClassCastException` (`ReferencedColumnsDescriptorImpl` → `ExecRowBuilder`) in the DataNucleus metastore layer — Derby-internal state corruption under the slow macOS-26 JDK21 run, with no Spark product line to fix. It passed on this run, consistent with a non-deterministic flake. Not addressed here.

Closes #57097 from HyukjinKwon/DO-NOT-MERGE/deflake-master.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <hyukjin.kwon@databricks.com>
(cherry picked from commit 8dcb844)
Signed-off-by: Hyukjin Kwon <hyukjin.kwon@databricks.com>
HyukjinKwon added a commit that referenced this pull request Jul 8, 2026
… extra listener events

### What changes were proposed in this pull request?

Fixes a flaky failure in scheduled CI on `master` (`build_maven_java21_macos26`, `sql#core - other tests`).

`FileDataSourceV2FallBackSuite` "Fallback Parquet V2 to V1" asserted `commands.length == 1` on a `QueryExecutionListener`. An extra eager `collect` callback on the analyzed `UnresolvedDataSource` can race onto the listener bus, making the count `2` and failing the test non-deterministically. Fixed by filtering the recorded events to the write `"command"` entry and asserting on that, instead of requiring the bus to contain exactly one event.

### Why are the changes needed?

The flake intermittently reds scheduled builds without indicating a real product regression.

### Does this PR introduce _any_ user-facing change?

No. Test-only change.

### How was this patch tested?

- Passes locally (`Tests: succeeded 5, failed 0`, including "Fallback Parquet V2 to V1").
- Fork CI (`build_maven_java21_macos26`, `sql#core - other tests`): ✅ **PASS** — https://github.com/HyukjinKwon/spark/actions/runs/28906196443
  `Tests: succeeded 19657, failed 0` — "All tests passed", with "Fallback Parquet V2 to V1" running clean. (The run's overall status shows a failure only from an unrelated `TransformWithStateAvroSuite` state-store schema-evolution flake in the separate `sql#core - slow tests` shard, which shares no code path with this test-only change.)

JIRA: https://issues.apache.org/jira/browse/SPARK-58030

### Related-but-not-fixed (documented for reviewers)

- **`DynamicPartitionPruningHiveScanSuiteAEOff` "broadcast a single key in a HashedRelation"** (`sql#hive - slow tests` on the same workflow): an embedded-Derby internal `ClassCastException` (`ReferencedColumnsDescriptorImpl` → `ExecRowBuilder`) in the DataNucleus metastore layer — Derby-internal state corruption under the slow macOS-26 JDK21 run, with no Spark product line to fix. It passed on this run, consistent with a non-deterministic flake. Not addressed here.

Closes #57097 from HyukjinKwon/DO-NOT-MERGE/deflake-master.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <hyukjin.kwon@databricks.com>
(cherry picked from commit 8dcb844)
Signed-off-by: Hyukjin Kwon <hyukjin.kwon@databricks.com>
HyukjinKwon added a commit that referenced this pull request Jul 8, 2026
… extra listener events

### What changes were proposed in this pull request?

Fixes a flaky failure in scheduled CI on `master` (`build_maven_java21_macos26`, `sql#core - other tests`).

`FileDataSourceV2FallBackSuite` "Fallback Parquet V2 to V1" asserted `commands.length == 1` on a `QueryExecutionListener`. An extra eager `collect` callback on the analyzed `UnresolvedDataSource` can race onto the listener bus, making the count `2` and failing the test non-deterministically. Fixed by filtering the recorded events to the write `"command"` entry and asserting on that, instead of requiring the bus to contain exactly one event.

### Why are the changes needed?

The flake intermittently reds scheduled builds without indicating a real product regression.

### Does this PR introduce _any_ user-facing change?

No. Test-only change.

### How was this patch tested?

- Passes locally (`Tests: succeeded 5, failed 0`, including "Fallback Parquet V2 to V1").
- Fork CI (`build_maven_java21_macos26`, `sql#core - other tests`): ✅ **PASS** — https://github.com/HyukjinKwon/spark/actions/runs/28906196443
  `Tests: succeeded 19657, failed 0` — "All tests passed", with "Fallback Parquet V2 to V1" running clean. (The run's overall status shows a failure only from an unrelated `TransformWithStateAvroSuite` state-store schema-evolution flake in the separate `sql#core - slow tests` shard, which shares no code path with this test-only change.)

JIRA: https://issues.apache.org/jira/browse/SPARK-58030

### Related-but-not-fixed (documented for reviewers)

- **`DynamicPartitionPruningHiveScanSuiteAEOff` "broadcast a single key in a HashedRelation"** (`sql#hive - slow tests` on the same workflow): an embedded-Derby internal `ClassCastException` (`ReferencedColumnsDescriptorImpl` → `ExecRowBuilder`) in the DataNucleus metastore layer — Derby-internal state corruption under the slow macOS-26 JDK21 run, with no Spark product line to fix. It passed on this run, consistent with a non-deterministic flake. Not addressed here.

Closes #57097 from HyukjinKwon/DO-NOT-MERGE/deflake-master.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <hyukjin.kwon@databricks.com>
(cherry picked from commit 8dcb844)
Signed-off-by: Hyukjin Kwon <hyukjin.kwon@databricks.com>
HyukjinKwon added a commit that referenced this pull request Jul 8, 2026
… extra listener events

### What changes were proposed in this pull request?

Fixes a flaky failure in scheduled CI on `master` (`build_maven_java21_macos26`, `sql#core - other tests`).

`FileDataSourceV2FallBackSuite` "Fallback Parquet V2 to V1" asserted `commands.length == 1` on a `QueryExecutionListener`. An extra eager `collect` callback on the analyzed `UnresolvedDataSource` can race onto the listener bus, making the count `2` and failing the test non-deterministically. Fixed by filtering the recorded events to the write `"command"` entry and asserting on that, instead of requiring the bus to contain exactly one event.

### Why are the changes needed?

The flake intermittently reds scheduled builds without indicating a real product regression.

### Does this PR introduce _any_ user-facing change?

No. Test-only change.

### How was this patch tested?

- Passes locally (`Tests: succeeded 5, failed 0`, including "Fallback Parquet V2 to V1").
- Fork CI (`build_maven_java21_macos26`, `sql#core - other tests`): ✅ **PASS** — https://github.com/HyukjinKwon/spark/actions/runs/28906196443
  `Tests: succeeded 19657, failed 0` — "All tests passed", with "Fallback Parquet V2 to V1" running clean. (The run's overall status shows a failure only from an unrelated `TransformWithStateAvroSuite` state-store schema-evolution flake in the separate `sql#core - slow tests` shard, which shares no code path with this test-only change.)

JIRA: https://issues.apache.org/jira/browse/SPARK-58030

### Related-but-not-fixed (documented for reviewers)

- **`DynamicPartitionPruningHiveScanSuiteAEOff` "broadcast a single key in a HashedRelation"** (`sql#hive - slow tests` on the same workflow): an embedded-Derby internal `ClassCastException` (`ReferencedColumnsDescriptorImpl` → `ExecRowBuilder`) in the DataNucleus metastore layer — Derby-internal state corruption under the slow macOS-26 JDK21 run, with no Spark product line to fix. It passed on this run, consistent with a non-deterministic flake. Not addressed here.

Closes #57097 from HyukjinKwon/DO-NOT-MERGE/deflake-master.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <hyukjin.kwon@databricks.com>
(cherry picked from commit 8dcb844)
Signed-off-by: Hyukjin Kwon <hyukjin.kwon@databricks.com>
HyukjinKwon added a commit that referenced this pull request Jul 8, 2026
… extra listener events

### What changes were proposed in this pull request?

Fixes a flaky failure in scheduled CI on `master` (`build_maven_java21_macos26`, `sql#core - other tests`).

`FileDataSourceV2FallBackSuite` "Fallback Parquet V2 to V1" asserted `commands.length == 1` on a `QueryExecutionListener`. An extra eager `collect` callback on the analyzed `UnresolvedDataSource` can race onto the listener bus, making the count `2` and failing the test non-deterministically. Fixed by filtering the recorded events to the write `"command"` entry and asserting on that, instead of requiring the bus to contain exactly one event.

### Why are the changes needed?

The flake intermittently reds scheduled builds without indicating a real product regression.

### Does this PR introduce _any_ user-facing change?

No. Test-only change.

### How was this patch tested?

- Passes locally (`Tests: succeeded 5, failed 0`, including "Fallback Parquet V2 to V1").
- Fork CI (`build_maven_java21_macos26`, `sql#core - other tests`): ✅ **PASS** — https://github.com/HyukjinKwon/spark/actions/runs/28906196443
  `Tests: succeeded 19657, failed 0` — "All tests passed", with "Fallback Parquet V2 to V1" running clean. (The run's overall status shows a failure only from an unrelated `TransformWithStateAvroSuite` state-store schema-evolution flake in the separate `sql#core - slow tests` shard, which shares no code path with this test-only change.)

JIRA: https://issues.apache.org/jira/browse/SPARK-58030

### Related-but-not-fixed (documented for reviewers)

- **`DynamicPartitionPruningHiveScanSuiteAEOff` "broadcast a single key in a HashedRelation"** (`sql#hive - slow tests` on the same workflow): an embedded-Derby internal `ClassCastException` (`ReferencedColumnsDescriptorImpl` → `ExecRowBuilder`) in the DataNucleus metastore layer — Derby-internal state corruption under the slow macOS-26 JDK21 run, with no Spark product line to fix. It passed on this run, consistent with a non-deterministic flake. Not addressed here.

Closes #57097 from HyukjinKwon/DO-NOT-MERGE/deflake-master.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <hyukjin.kwon@databricks.com>
(cherry picked from commit 8dcb844)
Signed-off-by: Hyukjin Kwon <hyukjin.kwon@databricks.com>
@HyukjinKwon

Copy link
Copy Markdown
Member Author

Merge Summary:

Posted by merge_spark_pr.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants