Skip to content

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
@LiYangSir LiYangSir force-pushed the enhance_entry_exit branch from 01d9098 to 04b32cc Compare May 4, 2023 08:15
@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
@LiYangSir LiYangSir force-pushed the enhance_entry_exit branch from 04b32cc to 3143bac Compare May 30, 2023 06:16
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