Skip to content

fix: prevent duplicate execution of testenvSettings.sh when DYNAMIC_COMPILE=false#6765

Merged
smlambert merged 4 commits intoadoptium:masterfrom
Agaba-derrick:testenvSettings.sh
Dec 4, 2025
Merged

fix: prevent duplicate execution of testenvSettings.sh when DYNAMIC_COMPILE=false#6765
smlambert merged 4 commits intoadoptium:masterfrom
Agaba-derrick:testenvSettings.sh

Conversation

@Agaba-derrick
Copy link
Copy Markdown
Contributor

Jenkins pipeline behavior (single-source of testenvSettings.sh)

  • Avoid re-sourcing testenvSettings.sh from JenkinsfileBase in non-dynamic compile scenarios to prevent double-sourcing when compile.sh already sources it.

  • Implement the change using a Groovy boolean conditional for DYNAMIC_COMPILE (i.e., if (params.DYNAMIC_COMPILE)), defaulting to NOT sourcing in the makeTestCmd command.

  • Ensures testenvSettings.sh is only sourced by Jenkins if DYNAMIC_COMPILE is enabled; otherwise it runs once under compile.sh.

Closes #5297

…OMPILE=false

Signed-off-by: Agaba-derrick <agabaderrick18@gmail.com>
@Agaba-derrick Agaba-derrick changed the title fix: prevent duplicate execution of testenvSettings.sh when DYNAMIC_C… fix: prevent duplicate execution of testenvSettings.sh when DYNAMIC_COMPILE=false Dec 1, 2025
@Agaba-derrick
Copy link
Copy Markdown
Contributor Author

@llxia kindly requesting for a review

Copy link
Copy Markdown
Contributor

@smlambert smlambert left a comment

Choose a reason for hiding this comment

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

thanks @Agaba-derrick - Some changes requested, then committers will run some testing against this PR to verify it.

Signed-off-by: Agaba-derrick <agabaderrick18@gmail.com>
Signed-off-by: Agaba-derrick <agabaderrick18@gmail.com>
// Note: keyword source cannot be used in Jenkins script. Therefore, using "." instead.
String makeTestCmd = "$RESOLVED_MAKE;cd ./aqa-tests; . ./scripts/testenv/testenvSettings.sh;cd ./TKG; \$MAKE $testParam"
// When DYNAMIC_COMPILE=false, do not source testenvSettings.sh. Only
// source the settings when env.DYNAMIC_COMPILE is true.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// source the settings when env.DYNAMIC_COMPILE is true.
// source those settings when env.DYNAMIC_COMPILE is true.

String tearDownCmd = "$RESOLVED_MAKE; \$MAKE -f ./aqa-tests/TKG/testEnv.mk testEnvTeardown"
// Note: keyword source cannot be used in Jenkins script. Therefore, using "." instead.
String makeTestCmd = "$RESOLVED_MAKE;cd ./aqa-tests; . ./scripts/testenv/testenvSettings.sh;cd ./TKG; \$MAKE $testParam"
// When DYNAMIC_COMPILE=false, do not source testenvSettings.sh. Only
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OK, but why?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

to avoid calling testenvSettings.sh twice during execution in pipelines

Co-authored-by: Martijn Verburg <martijnverburg@gmail.com>
@smlambert
Copy link
Copy Markdown
Contributor

Some test runs to verify:
https://ci.adoptium.net/job/Grinder/15712/ - USE_TESTENV_PROPERTIES=true, DYNAMIC_COMPILE=false
https://ci.adoptium.net/job/Grinder/15713/ - USE_TESTENV_PROPERTIES=true, DYNAMIC_COMPILE=true

Copy link
Copy Markdown
Contributor

@smlambert smlambert left a comment

Choose a reason for hiding this comment

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

Grinder runs confirm the script is now called only once in both cases (of DYNAMIC_COMPILE=true and DYNAMIC_COMPILE=false).
Thanks @Agaba-derrick !

@smlambert smlambert merged commit b7d5084 into adoptium:master Dec 4, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

testenvSettings.sh should only run once

3 participants