Skip to content

Conversation

@StefanRRichter
Copy link
Contributor

What is the purpose of the change

This PR is only adding the missing test case to guard our fix for FLINK-13249.

@flinkbot
Copy link
Collaborator

flinkbot commented Jul 18, 2019

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 846b50b (Tue Aug 06 15:51:31 UTC 2019)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!

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.

Details
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

@StefanRRichter
Copy link
Contributor Author

I created a test for the problem that is hopefully a good compromise between testing a rather low-level detail and not going to super deep in the IT case territory. Wdyt guys?

CC @zhijiangW

@flinkbot
Copy link
Collaborator

flinkbot commented Jul 18, 2019

CI report:

public void testRegularExecution() throws Exception {
final QueuedNoOpTaskManagerActions taskManagerActions = new QueuedNoOpTaskManagerActions();
final Task task = createTaskBuilder()
.setInvokable(TestInvokableCorrect.class)
Copy link
Contributor

Choose a reason for hiding this comment

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

This change might be a separate pre hotfix commit.

// helper functions
// ------------------------------------------------------------------------

private void setInputGate(Task task, SingleInputGate inputGate) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this legacy code remove could also be a separate commit.


{
invokable = AbstractInvokable.class;
taskManagerActions = mock(TaskManagerActions.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

It might use NoOpTaskManagerActions instead to avoid mock after refactoring.

invokable = AbstractInvokable.class;
taskManagerActions = mock(TaskManagerActions.class);

libraryCacheManager = mock(LibraryCacheManager.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto: ContextClassLoaderLibraryCacheManager.INSTANCE to avoid mock.

when(libraryCacheManager.getClassLoader(any(JobID.class))).thenReturn(getClass().getClassLoader());

consumableNotifier = new NoOpResultPartitionConsumableNotifier();
partitionProducerStateChecker = mock(PartitionProducerStateChecker.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

We could make NoOpPartitionProducerStateChecker public and use this.

new Configuration());

final BlobCacheService blobCacheService = new BlobCacheService(
mock(PermanentBlobCache.class),
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto: avoid mock if possible

resultPartitions,
inputGates,
0,
mock(MemoryManager.class),
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto: MemoryManager and IOManager


public static void setTaskState(Task task, ExecutionState state) {
try {
Field f = Task.class.getDeclaredField("executionState");
Copy link
Contributor

Choose a reason for hiding this comment

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

Another option is that we make the method Task#transitionState as package private.

Assert.assertFalse(
"Test ended by timeout or interruption - this indicates that the network thread was blocked.",
timedOutOrInterrupted.get());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be better to close NettyShuffleEnvironment and SingleInputGate finally.

/**
* Test to guard against FLINK-13249.
*/
@Test
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be better not to put this test among utility methods.

Copy link
Contributor

@zhijiangW zhijiangW left a comment

Choose a reason for hiding this comment

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

@StefanRRichter Thanks for opening this PR for covering the previous concerned bug fix.

This unit test looks good to me, only left some other nit comments.

@StephanEwen
Copy link
Contributor

I validated that the test indeed fails without the original fix.

Will address @zhijiangW's comments and merge this.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants