1

I have a jenkins job A and i have 5 tests (each triggering job A with updation of different jenkinsfile script path as Before Each test) executing in parallel

  • Test1 with pipeline-jenkinfile-1
  • Test2 with pipeline-jenkinfile-2
  • Test3 with pipeline-jenkinfile-3
  • Test4 with pipeline-jenkinfile-4
  • Test5 with pipeline-jenkinfile-5

When I start the tests in parallel, I can see 5 instance of same job getting triggered but each test is updated with incorrect jenkinsfile.

  • Test1 with pipeline-jenkinfile-4
  • Test2 with pipeline-jenkinfile-3
  • Test3 with pipeline-jenkinfile-1
  • Test4 with pipeline-jenkinfile-5
  • Test5 with pipeline-jenkinfile-2

Running on same node - NODE A

Test 1 Before step: Updating the jenkins job pipeline jenkinsFile script path using API

curl -X POST http://developer:developer@localhost:8080/job/test/config.xml --data-binary "@mymodifiedlocalconfig.xml"

And i trigger the job with buildwithParameters using rest api

curl -X POST http://USER:API_TOKEN@localhost:8080/job/test/build --data-urlencode json='{"parameter": [{"name":"paramA", "value":"123"}]}'

How to fix this such a way in parallel execution test update with correct jenkinsfile?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.