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

Test case for JENKINS-57253 #356

Merged
merged 1 commit into from
Dec 10, 2021
Merged

Conversation

basil
Copy link
Member

@basil basil commented May 7, 2020

Adding a test case for JENKINS-57253. The last assertion currently fails due to a leaked executor, as described in the bug, so I have marked the test with @Ignore. When the bug is fixed, the @Ignore annotation can be removed.

Copy link
Member

@dwnusbaum dwnusbaum 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 the PR! I am not sure if we can recover from this kind of error, we probably need to make groovy-cps fail during compilation when break (maybe also continue) is misused like this. In regular Groovy you get a compilation error with this message: "the break statement is only allowed inside loops or switches".

@dwnusbaum
Copy link
Member

dwnusbaum commented May 7, 2020

See cloudbees/groovy-cps#109 for the fix.

@dwnusbaum
Copy link
Member

dwnusbaum commented May 7, 2020

Also, did you happen to check whether things work correctly if you do put a loop or switch around the node step? If that causes problems, then we also need some kind of runtime behavior change in groovy-cps.

EDIT: Actually, I am pretty sure that break would be disallowed in something like for { node { break; } } because the closure is a new scope as far as break and continue are concerned.

@basil
Copy link
Member Author

basil commented May 7, 2020

Thank you for the fix!

Actually, I am pretty sure that break would be disallowed in something like for { node { break; } } because the closure is a new scope as far as break and continue are concerned.

Indeed, I confirmed that for { node { break; } } fails at the compilation stage as you predicted.

@car-roll
Copy link
Contributor

@basil fyi I merged cloudbees/groovy-cps#109 but I don't think it's getting released until we get the repo moved into jenkinsci.
I noticed that this test did not have an @Ignore. Is this issue already fixed via some other way?

@basil
Copy link
Member Author

basil commented Dec 10, 2021

@basil fyi I merged cloudbees/groovy-cps#109 but I don't think it's getting released until we get the repo moved into jenkinsci. I noticed that this test did not have an @Ignore. Is this issue already fixed via some other way?

Sorry, when I was merging with master I accidentally added some unrelated changes to this. I just corrected that. It now has the right set of changes with @Ignore.

@car-roll
Copy link
Contributor

@basil what confused me though was that the checks showed green. Did this test actually pass without any fix?

@basil
Copy link
Member Author

basil commented Dec 10, 2021

@basil what confused me though was that the checks showed green. Did this test actually pass without any fix?

They were green because I had posted an unrelated set of changes that happened to pass.

@car-roll car-roll added the tests label Dec 10, 2021
@car-roll car-roll merged commit 29a793d into jenkinsci:master Dec 10, 2021
@basil basil deleted the JENKINS-57253 branch December 13, 2021 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants