Skip to content

Conversation

liuml07
Copy link
Member

@liuml07 liuml07 commented Oct 9, 2025

https://issues.apache.org/jira/browse/FLINK-38488

Currently we have some tests using following patter:

try {
  doTestSomething();
  ...
} catch (Exception e) {
  e.printStackTrace();
  fail(e.getMessage());
}

This can be replaced by just throwing Exceptions in test and let JUnit handles the failure along with exception stack trace. The existing code loses stack trace information in test reports, and we need to look around in the stdout to guess.

As we can see other tests in Flink uses the "throws Exception" model:

  • The framework provides better formatting and integration with IDEs and CI systems
  • Test runners can distinguish between assertion failures and unexpected exceptions
  • Test logic is more readable without exception handling noise

@liuml07
Copy link
Member Author

liuml07 commented Oct 9, 2025

@ruanhang1993 I know you are tracking some testing improvements. Could you review this? Thanks,

@flinkbot
Copy link
Collaborator

flinkbot commented Oct 9, 2025

CI report:

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

@liuml07 liuml07 force-pushed the FLINK-38488 branch 3 times, most recently from 558ea34 to b74cf18 Compare October 9, 2025 06:17
@liuml07
Copy link
Member Author

liuml07 commented Oct 9, 2025

The testing failure seems unrelated as FLINK-38408 tracks the MapStateNullValueCheckpointingITCase which is not frequently reproducible. Meanwhile, e2e tests are failing with system error as in other builds.

Copy link
Contributor

@ruanhang1993 ruanhang1993 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think throw Exception is enough and better.

@ruanhang1993
Copy link
Contributor

@liuml07 Could you rebase the master branch and re-run the CI? The e2e tests have been fixed. Thanks.

@ruanhang1993
Copy link
Contributor

@flinkbot run azure

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.

3 participants