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

[JENKINS-53311] Wrong status of running builds #1807

Merged
merged 3 commits into from Sep 19, 2018
Merged

[JENKINS-53311] Wrong status of running builds #1807

merged 3 commits into from Sep 19, 2018

Conversation

@olamy
Copy link
Member

olamy commented Sep 17, 2018

Description

See JENKINS-53311.

Submitter checklist

  • Link to JIRA ticket in description, if appropriate.
  • Change is code complete and matches issue description
  • Appropriate unit or acceptance tests or explanation to why this change has no tests
  • Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.

Reviewer checklist

  • Run the changes and verified the change matches the issue description
  • Reviewed the code
  • Verified that the appropriate tests have been written or valid explanation given
olamy added 3 commits Sep 14, 2018
Signed-off-by: olivier lamy <olamy@apache.org>
…node is running prefer use of isActive

Signed-off-by: olivier lamy <olamy@apache.org>
Signed-off-by: olivier lamy <olamy@apache.org>
@olamy olamy requested review from vivek and dwnusbaum Sep 17, 2018
// StatusAndTiming.computeChunkStatus2 seems to return wrong status for parallel sequential stages
// so check check if active and in the case of nested sequential
if(parallelNestedStages && chunk.getFirstNode().isActive()) {
status = new NodeRunStatus(chunk.getFirstNode());

This comment has been minimized.

Copy link
@dwnusbaum

dwnusbaum Sep 17, 2018

Member

Does this only fix the issue if the sleep is in the first sequential stage? What if the test case is the following:

pipeline {
    agent any
    stages {
        stage('Parallel') {
            parallel {
                stage('Nested A') {
                    steps {
                        echo 'A'
                    }
                }
                stage('Nested B') {
                    stages {
                        stage('Nested B-1') {
                            steps {
                                echo 'B'
                            }
                        }
                        stage('Nested B-2') {
                            steps {
                                sleep time: 10, unit: 'SECONDS'
                            }
                        }
                    }
                }
            }
        }
    }
}

This comment has been minimized.

Copy link
@olamy

olamy Sep 17, 2018

Author Member

yes no problem that work.
I think you are a bit of confused by the method name (getFirstNode) there is nothing related to the number of stages. A chunk is a kind of container with multiple nodes on it.

This comment has been minimized.

Copy link
@dwnusbaum

dwnusbaum Sep 18, 2018

Member

@olamy Yeah I was definitely confused by the name, thanks for answering!

@vivek
vivek approved these changes Sep 18, 2018
Copy link
Collaborator

vivek left a comment

LGTM, nice one @olamy!

@olamy olamy merged commit f041758 into master Sep 19, 2018
1 check passed
1 check passed
continuous-integration/jenkins/branch This commit looks good
Details
@olamy olamy deleted the bug/JENKINS-53311 branch Sep 19, 2018
vivek added a commit that referenced this pull request Sep 19, 2018
* add junit to show the issue

Signed-off-by: olivier lamy <olamy@apache.org>

* avoid using flowNode.isRunning as it looks to return wrong while the node is running prefer use of isActive

Signed-off-by: olivier lamy <olamy@apache.org>

* add comment

Signed-off-by: olivier lamy <olamy@apache.org>
@vivek vivek mentioned this pull request Sep 19, 2018
0 of 7 tasks complete
vivek added a commit that referenced this pull request Sep 20, 2018
* add junit to show the issue

Signed-off-by: olivier lamy <olamy@apache.org>

* avoid using flowNode.isRunning as it looks to return wrong while the node is running prefer use of isActive

Signed-off-by: olivier lamy <olamy@apache.org>

* add comment

Signed-off-by: olivier lamy <olamy@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.