jenkinsci / jenkinsci/java-client-api

when running in multithreading separate thread triggers the build

Open
#311 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
913
Forks
466
PR merge metrics
No merged PRs in 30d

Description

Running this code in parallel only starts one build, since they all refere to the same queue item
I am creating new jenkins server for each thread but using the same credentials
` try {

MTJenkinsUtil mtJenkinsUtil = new MTJenkinsUtil();
JenkinsServer jenkinsServer = mtJenkinsUtil.getJenkinsServer();
Job myJob = jenkinsServer.getJob(job);
String queue = myJob.build(params, true).getQueueItemUrlPart();
LOGGER.info(queue);
//BuildWithDetails buildWithDetails = qaJenkinsServer.
`

10:57:59.219 [pool-1-thread-3] INFO TestMTJobild - https://qajenkins/queue/item/5160/
10:57:59.225 [pool-1-thread-2] INFO TestMTJobild - https://qajenkins/queue/item/5160/
10:57:59.227 [pool-1-thread-1] INFO TestMTJobild - https://qajenkins/queue/item/5160/
10:57:59.227 [pool-1-thread-4] INFO TestMTJobild - https://qajenkins/queue/item/5160/

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.