flink icon indicating copy to clipboard operation
flink copied to clipboard

Fix flaky tests in classes PartitionableSourceTest and PushPartitionIntoTableSourceScanRuleTest

Open nikunjagarwal321 opened this issue 1 year ago • 1 comments

What is the purpose of the change

NonDex is a tool for detecting and debugging wrong assumptions on under-determined Java APIs. While running the test cases using NonDex, flaky tests were found in the following classes :

  • org.apache.flink.table.planner.plan.batch.sql.PartitionableSourceTest
  • org.apache.flink.table.planner.plan.rules.logical.PushPartitionIntoTableSourceScanRuleTest

The flaky tests can be found when running the following command: mvn edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest={test}

Sample Error :

PartitionableSourceTest.testUnconvertedExpression:136 optimized exec plan ==> expected: <
Calc(select=[id, name, part1, part2, (part2 + 1) AS virtualField])
+- TableSourceScan(table=[[default_catalog, default_database, PartitionableTable, partitions=[{part1=A, part2=2}]]], fields=[id, name, part1, part2])
> but was: <
Calc(select=[id, name, part1, part2, (part2 + 1) AS virtualField])
+- TableSourceScan(table=[[default_catalog, default_database, PartitionableTable, partitions=[{part2=2, part1=A}]]], fields=[id, name, part1, part2])
>
  • The fix is to include ordering in PartitionPushDownSpec and PushPartitionIntoTableSourceScanRuleTest while converting from Map to String in order to maintain the same order of Map while converting to String and thus, make the tests more stable. The function : getDigests() converts the partitions to String and the ordering of different objects of Map may differ as it is nondeterministic. Also the expected string which are used in test files are hardcoded in XML files and only contain one set of ordering.

Hence, we can convert the nondeterministic ordering in PartitionPushDownSpec.getDigests() to get the ordered value of Map as the string plan.

Brief change log

(for example:)

  • The TaskInfo is stored in the blob store on job creation time as a persistent artifact
  • Deployments RPC transmits only the blob storage reference
  • TaskManagers retrieve the TaskInfo from the blob cache

Verifying this change

This change is already covered by existing tests, such as org.apache.flink.table.planner.plan.batch.sql.PartitionableSourceTest.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: don't know
  • 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

nikunjagarwal321 avatar Oct 10 '24 01:10 nikunjagarwal321

CI report:

  • 4bde8abfacf7f25ccbb6c8cc4ddd206ae7d57c51 Azure: FAILURE
Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

flinkbot avatar Oct 10 '24 01:10 flinkbot

This PR is being marked as stale since it has not had any activity in the last 90 days. If you would like to keep this PR alive, please leave a comment asking for a review. If the PR has merge conflicts, update it with the latest from the base branch.

If you are having difficulty finding a reviewer, please reach out to the community, contact details can be found here: https://flink.apache.org/what-is-flink/community/

If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed.

github-actions[bot] avatar Apr 08 '25 06:04 github-actions[bot]

This PR has been closed since it has not had any activity in 120 days. If you feel like this was a mistake, or you would like to continue working on it, please feel free to re-open the PR and ask for a review.

github-actions[bot] avatar May 09 '25 06:05 github-actions[bot]