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

Added SemaphoreStep.waitForStart() for workflow to wait until semapho… #531

Conversation

cdgopal
Copy link
Contributor

@cdgopal cdgopal commented Apr 5, 2024

Description and fix:
Previously, reliance on specific console messages for synchronization could lead to inconsistency and intermittent failures. By shifting to semaphore-based synchronization, the workflow ensures stability and predictability in execution.

Transitioning to SemaphoreStep.waitForStart() provides a more reliable synchronization approach, reducing flakiness risk linked to console message dependency.

Following is the error:
image
image

image

Submitter checklist

@@ -173,7 +173,7 @@ public void addContentsFiltered() throws Exception {
WorkflowRun workflowRun = Optional.ofNullable(p.scheduleBuild2(0))
.orElseThrow(AssertionFailedError::new)
.waitForStart();
j.waitForMessage("Running on", workflowRun);
SemaphoreStep.waitForStart("wait/1", workflowRun);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compare

p.setDefinition(new CpsFlowDefinition("node('test') {semaphore 'wait'}", true));
and

@jglick jglick added this pull request to the merge queue Apr 8, 2024
Merged via the queue into jenkinsci:master with commit d013439 Apr 8, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants