Hi Rin.

The main point of this issue is, that the Gerrit Trigger fails evaluating patch sets correctly. You can confuse it with the manual trigger so much, that it forgets that it needs to wait 2 tests to complete, before it can approve or deny a change.

Taking a look at the log in my original submission, the issue is as follows.

I uploaded the patch-set, and let the two tests continue running. The message uploaded by the plugin is correct so far:

-------------------------------------------------------
Jenkins
Patch Set 1: -Verified
Build Started Test_2/1/ (1/2)
-------------------------------------------------------
Jenkins
Patch Set 1:
Build Started Test_1/1/ (2/2)
-------------------------------------------------------

This is all normal behaviour. It notified the user of the start, and waits for the jobs to finish, before deciding on a verdict.

Now while those two jobs were still running, I started a "manual retrigger" on the same patch set, causing Gerrit Trigger to spawn two new builds:

-------------------------------------------------------
Jenkins
Patch Set 1:
Build Started Test_2/2/ (2/2)
-------------------------------------------------------
Jenkins
Patch Set 1:
Build Started Test_1/2/ (2/2)
-------------------------------------------------------

It did not need to do a "-Verified", as it knows that it is currently building the same patchset. If you have enabled the "Only build on newest patchset" feature, it even helpfully aborts the two previous jobs for you.

But there's something wrong here: It actually lost count of the number of tests it started. Instead of writing (1/2) & (2/2) – or maybe even (3/4) & (4/4) – it instead writes (2/2) twice. So it lost count.

This might not be so bad, but now, the bug strikes, when we deliberately let only "Test_2" finish, which always succeeds. Remember, Gerrit Trigger should wait for BOTH tests to finish.

-------------------------------------------------------
Jenkins
Patch Set 1: Verified+1
Build Successful 
Test_2/2/ : SUCCESS
-------------------------------------------------------

As you can see, it did not wait. It immediately uploaded a Verified+1. If you have any form of auto-commit in Gerrit, this is immediately deadly. It also allows users to (accidentally) subvert the verification process.

I will try to replicate this again later on my machine, and look if I also get an NPE.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to