Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-18355][tests] Simplify tests of SlotPoolImpl #12917

Merged
merged 7 commits into from Aug 13, 2020

Conversation

Thesharing
Copy link
Contributor

@Thesharing Thesharing commented Jul 17, 2020

What is the purpose of the change

Tests of SlotPoolImpl, including SlotPoolImplTest and SlotPoolInteractionsTest, are somehow unnecessarily complicated in the code involvement. E.g. SchedulerImp built on top of SlotPoolImpl is used to allocate slots from SlotPoolImpl, which can be simplified by directly invoke slot allocation on SlotPoolImpl.

Besides that, there are quite some duplications between tests classes of SlotPoolImpl, this further includes SlotPoolPendingRequestFailureTest, SlotPoolRequestCompletionTest and SlotPoolBatchSlotRequestTest.

Brief change log

  • Use SlotPoolBuilder and SlotPoolUtils to refactor test cases related to SlotPoolImpl
  • Remove the usages of SchedulerImp for slotpool testing
  • Other possible simplifications

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

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

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@Thesharing Thesharing closed this Jul 17, 2020
@Thesharing Thesharing changed the title [TEST] Try to remove the SchedulerImpl in testAllocateSimpleSlot [WIP] [Tests] Try to remove the SchedulerImpl in testAllocateSimpleSlot Jul 17, 2020
@Thesharing Thesharing reopened this Jul 17, 2020
@flinkbot
Copy link
Collaborator

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit e9db5e6 (Fri Jul 17 07:44:33 UTC 2020)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!
  • Invalid pull request title: No valid Jira ID provided

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.


The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@flinkbot
Copy link
Collaborator

flinkbot commented Jul 17, 2020

CI report:

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

@Thesharing Thesharing force-pushed the master branch 2 times, most recently from deb6fa0 to dcc6cc2 Compare July 20, 2020 03:56
@Thesharing Thesharing changed the title [WIP] [Tests] Try to remove the SchedulerImpl in testAllocateSimpleSlot [WIP] [FLINK-18355][tests] Simplify tests of SlotPoolImpl Jul 20, 2020
Copy link
Contributor

@zhuzhurk zhuzhurk left a comment

Choose a reason for hiding this comment

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

Thanks for opening this PR @Thesharing .
I left a few comments for the first commit. Will continue reviewing the other commits.

@Thesharing Thesharing force-pushed the master branch 2 times, most recently from 1c5870c to 664fa0a Compare July 27, 2020 03:55
Copy link
Contributor Author

@Thesharing Thesharing left a comment

Choose a reason for hiding this comment

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

Really appreciate for your reviews. I've already made fixes according to your comments and submitted a fix-up commit.

@zhuzhurk zhuzhurk changed the title [WIP] [FLINK-18355][tests] Simplify tests of SlotPoolImpl [FLINK-18355][tests] Simplify tests of SlotPoolImpl Jul 30, 2020
@zhuzhurk zhuzhurk marked this pull request as ready for review July 30, 2020 06:36
Copy link
Contributor Author

@Thesharing Thesharing left a comment

Choose a reason for hiding this comment

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

I've already pushed a fix-up commit about "Refactor SlotPoolImplTest with SlotPoolTestBase".

Copy link
Contributor Author

@Thesharing Thesharing left a comment

Choose a reason for hiding this comment

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

Thanks for your review. It's really nice of you. I've fixed some of them according to your comments.

Copy link
Contributor Author

@Thesharing Thesharing left a comment

Choose a reason for hiding this comment

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

Thanks for your review. I've already got it fixed according to your comments.

@Thesharing Thesharing force-pushed the master branch 2 times, most recently from bce6761 to 7764044 Compare August 5, 2020 06:37
Copy link
Contributor Author

@Thesharing Thesharing left a comment

Choose a reason for hiding this comment

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

Thanks for your review. I've get it fixed according to your comments and force push the newest codes.

Copy link
Contributor Author

@Thesharing Thesharing left a comment

Choose a reason for hiding this comment

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

Sorry for being so careless. I'll be more careful next time. Thank you for your review.

@Thesharing
Copy link
Contributor Author

@flinkbot run azure

@Thesharing Thesharing requested a review from zentol August 6, 2020 07:52
@Thesharing
Copy link
Contributor Author

@flinkbot run travis

@Thesharing
Copy link
Contributor Author

I've already rebased my commits on the latest master branch. Would you please take a look, @zhuzhurk ?

@zhuzhurk
Copy link
Contributor

LGTM. Merging since AZP gives green.

@zhuzhurk zhuzhurk merged commit 8593489 into apache:master Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants