We're running into an issue with httpRequest in a Groovy script used on a mutlibranch pipeline job.
I have code that looks something like this:
When this code runs, I expect for the httpRequest to return the response, the code to get printed out from my println, then checkResults to return the number of failed tests it detected (code not shown). However, that's not what happens.
Instead, sendMessage immediately return without executing my println, and most oddly of all, checkResults ends up returning the HTTP Response from httpRequest! How is this even possible?
The symptom, other than my println doing nothing, is that the > 0 comparison in the Jenkinsfile doesn't work and this exception is thrown:
It's possible that I'm doing something wrong here, but this seems very much like a bug. It's hard for me to imagine what I could do wrong that would cause the stack to get blown apart in such a way.