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

Remove the requirement of carrying args in entry.exit() #3114

Merged
merged 2 commits into from
Jun 14, 2023

Conversation

LiYangSir
Copy link
Contributor

Describe what this PR does / why we need it

Remove the requirement of carrying args or batchCount in entry.exit() so that users don't need to carry args or batchCount on Entry exit.

Does this pull request fix one issue?

Fixes #3109

Describe how you did it

Hold args and batchCount in Entry when initialized, when calling the no-argument exit() method, use the hold data

Describe how to verify it

Use unit test to verify the correctness of totalSuccess() method

@Test
public void testEntryExitAutomation() throws BlockException{
    String[] args = {"foo", "baz"};
    int batchCount = 3;
    Entry e = SphU.entry("resourceName", EntryType.IN, 3, args);
    e.exit();
    assertEquals(batchCount, e.getCurNode().totalSuccess());
}

Special notes for reviews

NONE

@LiYangSir LiYangSir changed the title Remove the requirement of carrying args in entry.exit() #3109 Remove the requirement of carrying args in entry.exit() May 4, 2023
@sczyh30 sczyh30 added the kind/enhancement Category issues or prs related to enhancement. label May 5, 2023
@sczyh30 sczyh30 self-requested a review May 5, 2023 13:31
@sczyh30 sczyh30 requested a review from LearningGp May 28, 2023 08:22
int batchCount = 3;
Entry e = SphU.entry("testEntryExitAutomation", EntryType.IN, 3, args);
e.exit();
assertEquals(batchCount, e.getCurNode().totalSuccess());
Copy link
Member

Choose a reason for hiding this comment

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

This does not actually verify the case here.

Copy link
Member

@sczyh30 sczyh30 left a comment

Choose a reason for hiding this comment

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

LGTM

@sczyh30 sczyh30 merged commit 1fbc226 into alibaba:master Jun 14, 2023
@sczyh30
Copy link
Member

sczyh30 commented Jun 14, 2023

Nice work. Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Category issues or prs related to enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove the requirement of carrying args in entry.exit()
2 participants