[JIRA] (JENKINS-46076) Test flake in CpsThreadTest.stop

0 views
Skip to first unread message

svanoort@cloudbees.com (JIRA)

unread,
Nov 16, 2018, 12:39:02 PM11/16/18
to jenkinsc...@googlegroups.com
Sam Van Oort closed an issue as Fixed
 

I believe this one was resolved in my 1Q/2Q 2018 work to resolve persistence and order of operation issues. We can re-open if it recurs though.

Jenkins / Bug JENKINS-46076
Test flake in CpsThreadTest.stop
Change By: Sam Van Oort
Status: Open Closed
Resolution: Fixed
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

dnusbaum@cloudbees.com (JIRA)

unread,
Jan 14, 2019, 1:03:02 PM1/14/19
to jenkinsc...@googlegroups.com
Devin Nusbaum reopened an issue
Change By: Devin Nusbaum
Resolution: Fixed
Status: Closed Reopened

dnusbaum@cloudbees.com (JIRA)

unread,
Jan 14, 2019, 1:03:03 PM1/14/19
to jenkinsc...@googlegroups.com
Devin Nusbaum commented on Bug JENKINS-46076
 
Re: Test flake in CpsThreadTest.stop

Just saw this again today locally building 561de1059c.

dnusbaum@cloudbees.com (JIRA)

unread,
May 28, 2019, 5:12:02 PM5/28/19
to jenkinsc...@googlegroups.com

I saw this flake again today along with ParallelStepTest.failureReporting. Both failed looking for Finished: $RESULT. I think it might have to do with the same problem I ran into in Declarative which I worked around by adding a sleep when the result did not match and checking again, see here.

dnusbaum@cloudbees.com (JIRA)

unread,
May 28, 2019, 5:13:02 PM5/28/19
to jenkinsc...@googlegroups.com
Devin Nusbaum edited a comment on Bug JENKINS-46076
I saw this flake again today along with {{ParallelStepTest.failureReporting}}. Both failed looking for {{Finished: $RESULT}}. I think it might have to do with the same a similar problem I ran into in Declarative which I worked around by adding a sleep when checking the build result did not match fails and checking again, see [here|https://github.com/jenkinsci/pipeline-model-definition-plugin/blob/31569c0385f555f0b3146c68eb748a5dcf16efd6/pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java#L511-L539].

jglick@cloudbees.com (JIRA)

unread,
Jun 3, 2019, 10:50:03 AM6/3/19
to jenkinsc...@googlegroups.com
Jesse Glick updated an issue
 
Test flake in CpsThreadTest.stop

I think this is a race condition between waitForMessage and WorkflowRun.finish. The latter sets a completed flag prior to calling BuildListener.finished. The former stops waiting for a message once the build is marked complete. Either finish should be reordered a bit, or waitForMessage should wait for Finished: to appear after !logUpdated. Alternately, individual tests can just avoid using waitForMessage on Finished: … arguments and implement it directly, as I have done in a couple places.

Change By: Jesse Glick
Component/s: jenkins-test-harness
Component/s: workflow-job-plugin

jglick@cloudbees.com (JIRA)

unread,
Jun 7, 2019, 10:40:02 AM6/7/19
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Jun 7, 2019, 10:40:03 AM6/7/19
to jenkinsc...@googlegroups.com
Jesse Glick assigned an issue to Jesse Glick
Change By: Jesse Glick
Assignee: Jesse Glick

jglick@cloudbees.com (JIRA)

unread,
Jun 7, 2019, 10:40:04 AM6/7/19
to jenkinsc...@googlegroups.com
Jesse Glick started work on Bug JENKINS-46076
 
Change By: Jesse Glick
Status: Open In Progress

jglick@cloudbees.com (JIRA)

unread,
Jun 7, 2019, 11:10:02 AM6/7/19
to jenkinsc...@googlegroups.com

Reproducible with

diff --git a/pom.xml b/pom.xml
index 3e1b3830..41948296 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,7 +84,7 @@
         <dependency>
             <groupId>org.jenkins-ci.plugins.workflow</groupId>
             <artifactId>workflow-api</artifactId>
-            <version>2.30</version>
+            <version>2.32</version>
         </dependency>
         <dependency>
             <groupId>org.jenkins-ci.plugins.workflow</groupId>
@@ -152,7 +152,7 @@
         <dependency>
             <groupId>org.jenkins-ci.plugins.workflow</groupId>
             <artifactId>workflow-job</artifactId>
-            <version>2.26</version>
+            <version>2.33-SNAPSHOT</version>
             <scope>test</scope>
         </dependency>
         <dependency>

picking up

diff --git a/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java b/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
index 2eaac3a..f630809 100644
--- a/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
+++ b/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
@@ -577,6 +577,11 @@ public final class WorkflowRun extends Run<WorkflowJob,WorkflowRun> implements F
             completed = Boolean.TRUE;
             duration = Math.max(0, System.currentTimeMillis() - getStartTimeInMillis());
         }
+        try {
+            Thread.sleep(3_000);
+        } catch (InterruptedException x) {
+            x.printStackTrace();
+        }
         try {
             LOGGER.log(Level.INFO, "{0} completed: {1}", new Object[]{toString(), getResult()});
             if (nullListener) {

jglick@cloudbees.com (JIRA)

unread,
Jun 10, 2019, 12:15:07 PM6/10/19
to jenkinsc...@googlegroups.com

dnusbaum@cloudbees.com (JIRA)

unread,
Jun 27, 2019, 2:05:02 PM6/27/19
to jenkinsc...@googlegroups.com
Devin Nusbaum updated an issue
Change By: Devin Nusbaum
Released As: workflow-job 2.33

jglick@cloudbees.com (JIRA)

unread,
Jul 1, 2019, 10:07:02 AM7/1/19
to jenkinsc...@googlegroups.com
 

Still one PR open, but originally reported test flake should now be addressed.

Change By: Jesse Glick
Status: In Review Resolved
Resolution: Fixed

royarnon@gmail.com (JIRA)

unread,
Aug 24, 2019, 9:16:02 AM8/24/19
to jenkinsc...@googlegroups.com
Roy Arnon updated an issue
Change By: Roy Arnon
Attachment: plugins.txt

royarnon@gmail.com (JIRA)

unread,
Aug 24, 2019, 9:17:02 AM8/24/19
to jenkinsc...@googlegroups.com

Hi Jesse Glick, I believe this ticked caused an issue with our jenkins instance.

The issue I was seeing was causing builds to be stuck forever in queue -

 

I ran 

Jenkins.instance.getItemByFullName(...).getBuildByNumber(..).isLogUpdated()

On the previous build, and the result was true. I believe this was causing the blockage.

A downgrade to workflow-job 2.32 fixed the issue for us. I can gather more information if you like and try to reproduce the issue on our test instance.

We are using jenkins 2.176.2.

I have attached a list of our plugins as well - plugins.txt

jglick@cloudbees.com (JIRA)

unread,
Aug 25, 2019, 1:00:02 PM8/25/19
to jenkinsc...@googlegroups.com

Roy Arnon please file a separate issue, Link’d to this one, with the regression label, and whatever steps to reproduce you can manage to put together.

royarnon@gmail.com (JIRA)

unread,
Aug 26, 2019, 9:02:02 AM8/26/19
to jenkinsc...@googlegroups.com

Jesse Glick done - JENKINS-59083

I have also reproduced this issue on our test instance, if you need any more information please let me know.

Reply all
Reply to author
Forward
0 new messages