adoptium / aqa-tests

Home of test infrastructure for Adoptium builds
https://adoptium.net/aqavit
Apache License 2.0
132 stars 312 forks source link

Support server and client testing #2841

Closed llxia closed 2 years ago

llxia commented 3 years ago

In some cases, two machines are needed for testing. For example, some performance tests will need to communicate between server and client. We need to update our test pipeline to support this case.

Proposed solution:

llxia commented 3 years ago

FYI @awsafsakif @smlambert

awsafsakif commented 3 years ago

We also need a check to see if CLIENT_NODE machine is idle before triggering the reservation job. Otherwise we will run into an issue where if the client machine is already busy running a different benchmark, the reservation job will be scheduled but not triggered.

Extra variables required: TIMEOUT: How long server machine will be active in jenkins till job is cancelled, INTERVAL: How often to check if CLIENT_NODE is idle before triggering machine reservation and continuing with the benchmark run.

llxia commented 3 years ago

Yes, for checking if a node is available https://stackoverflow.com/questions/37227562/how-to-know-whether-the-jenkins-build-executors-are-idle-or-not-in-jenkins-using/37238045

Also, we have similar code to use the API: https://github.com/adoptium/aqa-tests/blob/master/buildenv/jenkins/openjdk_tests#L300

smlambert commented 2 years ago

Created https://ci.adoptopenjdk.net/job/Machine-Reservation job as a placeholder for a pipeline described in this issue.

@norbline - if you have not already done so, please rebase your branch (described in Contributing.md) in preparation to begin work on this issue. I believe @llxia will share some code with you relating to Machine-Reservation shortly.

llxia commented 2 years ago

TODO:

smlambert commented 2 years ago

Hi @norbline - can you add a comment in this issue, so I can assign it to you?

Grinder_Perforama job is created for you to use to help test your work: https://ci.adoptopenjdk.net/job/Grinder_Perforama/

When you "Build with parameters, you should see the new parameter RELATED_NODES at the bottom just above the Build button.

norbline commented 2 years ago

Thanks, Shelley. All good to get on

On Thu, Jan 27, 2022, 5:56 PM Shelley Lambert @.***> wrote:

Hi @norbline https://github.com/norbline - can you add a comment in this issue, so I can assign it to you?

Grinder_Perforama job is created for you to use to help test your work: https://ci.adoptopenjdk.net/job/Grinder_Perforama/

When you "Build with parameters, you should see the new parameter RELATED_NODES at the bottom just above the Build button.

— Reply to this email directly, view it on GitHub https://github.com/adoptium/aqa-tests/issues/2841#issuecomment-1023438077, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJOPRPBAM2GN5OEVUIJE6RDUYF2MJANCNFSM5DHIPHRA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

smlambert commented 2 years ago
Screen Shot 2022-01-28 at 7 40 50 PM
llxia commented 2 years ago

@norbline For using Jenkins API to get job stage status, I found a similar thing at StackOverflow: https://stackoverflow.com/questions/37009906/access-stage-results-in-workflow-pipeline-plugin Could you give it a try both REST API and groovy code? Thanks

norbline commented 2 years ago

yes @llxia I will give it a try

llxia commented 2 years ago

After the investigation and experiments, we decided to use nested nodes instead of Jenkins API. In this way, we do not need to control the workflow/communication between two jobs. It is easy to maintain and less error-prone.

The key changes for nested notes are delivered via #3364 and #3379. Enhancements:

https://github.com/adoptium/aqa-tests/blob/25c804602873d503ec596371875c33a49fa88ad2/buildenv/jenkins/openjdk_tests#L100-L236

norbline commented 2 years ago

Thanks @llxia

llxia commented 2 years ago

@awsafsakif could you test your case and let us know? Thanks.

llxia commented 2 years ago

Verified in Grinder that we can directly get RELATED_NODES in playlist. There is no need to set it as an env variable.

In the console output, test-docker-ubuntu2010-x64-2 is printed.

00:02:37.449  ===============================================
00:02:37.449  Running test IdleMicrobenchmark_HS_0 ...
00:02:37.449  ===============================================
00:02:37.449  IdleMicrobenchmark_HS_0 Start Time: Fri Mar 11 20:12:57 2022 Epoch Time (ms): 1647029577279
00:02:37.449  Nothing to be done for setup.
00:02:37.449  variation: -Xmx1024m
00:02:37.449  JVM_OPTIONS:  -Xmx1024m 
00:02:37.449  { itercnt=1; \
00:02:37.449  mkdir -p "/home/jenkins/workspace/Grinder_Perforama/aqa-tests/TKG/../TKG/output_16470295765006/IdleMicrobenchmark_HS_0"; \
00:02:37.450  cd "/home/jenkins/workspace/Grinder_Perforama/aqa-tests/TKG/../TKG/output_16470295765006/IdleMicrobenchmark_HS_0"; \
00:02:37.450  echo test-docker-ubuntu2010-x64-2; mkdir -p "/home/jenkins/workspace/Grinder_Perforama/aqa-tests/TKG/../TKG/output_16470295765006/IdleMicrobenchmark_HS_0"; \
00:02:37.450  cd /home/jenkins/workspace/Grinder_Perforama/aqa-tests/TKG/../../jvmtest/perf/idle_micro; \
00:02:37.450  "/home/jenkins/workspace/Grinder_Perforama/openjdkbinary/j2sdk-image/bin/java"  -Xmx1024m  \
00:02:37.450  -cp ":/home/jenkins/workspace/Grinder_Perforama/aqa-tests/TKG/../../jvmtest/perf/idle_micro/IdleMicrobenchmark.jar" net.adoptopenjdk.test.gc.idlemicrobenchmark.IdleMicroBenchmark \
00:02:37.450  --memoryLimit=700 --time=60 --idletime=300 --warmup=1 >"/home/jenkins/workspace/Grinder_Perforama/aqa-tests/TKG/../TKG/output_16470295765006/IdleMicrobenchmark_HS_0"/std.out 2>&1 ; \
00:02:37.450  if [ $? -eq 0 ] ; then echo ""; echo "IdleMicrobenchmark_HS_0""_PASSED"; echo ""; cd /home/jenkins/workspace/Grinder_Perforama/aqa-tests/TKG/..;  else echo ""; echo "IdleMicrobenchmark_HS_0""_FAILED"; echo ""; fi; } 2>&1 | tee -a "/home/jenkins/workspace/Grinder_Perforama/aqa-tests/TKG/../TKG/output_16470295765006/TestTargetResult";
00:02:37.450  test-docker-ubuntu2010-x64-2

FYI @awsafsakif

llxia commented 2 years ago

The feature is implemented. The task about - add timestamp{} to provide more info is optional and it is tracked in https://github.com/adoptium/aqa-tests/issues/3396 Close this issue.