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

Set ulimit for sharedclasscache multithread tests #2274

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions system/sharedClasses/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
<variation>Mode110</variation>
<variation>Mode610</variation>
</variations>
<command>if [[ ! $(Q)$(PLATFORM)$(Q) == *$(Q)win$(Q)* ]] ; then export original_umask_val=`umask` $(AND_IF_SUCCESS) umask 0002 $(AND_IF_SUCCESS) echo umask set to `umask`; fi; \
<command>if ! echo "$(PLATFORM)" | grep -q "win"; then export original_umask_val=`umask` $(AND_IF_SUCCESS) umask 0002 $(AND_IF_SUCCESS) echo umask set to `umask`; fi; \
$(SYSTEMTEST_CMD_TEMPLATE) -test=SharedClassesAPI; \
if [[ ! $(Q)$(PLATFORM)$(Q) == *$(Q)win$(Q)* ]] ; then umask $$original_umask_val $(AND_IF_SUCCESS) echo umask set to `umask`; fi; \
$(TEST_STATUS)</command>
<levels>
<level>extended</level>
Expand Down Expand Up @@ -185,7 +184,13 @@
<variation>Mode110</variation>
<variation>Mode610</variation>
</variations>
<command>$(SYSTEMTEST_CMD_TEMPLATE) -test=SharedClasses -test-args=$(Q)sharedClassMode=SCM01,sharedClassTest=MultiThread$(Q); \
<!-- Some machines may have max user processes too low by default for this test
- e.g. see https://github.com/AdoptOpenJDK/openjdk-infrastructure/issues/1851
The command is not relevant to Windows, and ulimit cannot be modified by the Jenkins users on osx.
Max user processes option is -u in bash, -p in dash (-p is pipe size in bash, so the validity of ulimit -u is used to set the correct option). -->
<command>echo "$(PLATFORM)" | grep -q "osx\|win" || \
{ MXP_FLAG=$$(test $$(ulimit -u 2>/dev/null) $(AND_IF_SUCCESS) echo "-u" || echo "-p"); REQD_MXP=2048; if [ ! "$$(ulimit $$MXP_FLAG)" = "unlimited" ] $(AND_IF_SUCCESS) [ ! $$(ulimit $$MXP_FLAG) -gt $$REQD_MXP ]; then echo Attempting to increase max user processes from $$(ulimit $$MXP_FLAG) to $$REQD_MXP; ulimit $$MXP_FLAG $$REQD_MXP; echo max user processes now $$(ulimit $$MXP_FLAG); fi; }; \
$(SYSTEMTEST_CMD_TEMPLATE) -test=SharedClasses -test-args=$(Q)sharedClassMode=SCM01,sharedClassTest=MultiThread$(Q); \
Copy link
Contributor

Choose a reason for hiding this comment

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

Since it's only the "max user processes" field that's being updated here, can we just output ulimit -u, instead of the full ulimit -a here? Since we are already printing out ulimit -a via MachineInfo, printing the whole ulimit -a output again seems to increase the job output text unnecessarily.

In other words, can we do something along the line of the following? :-

echo "ulimit -u set to: `ulimit -u`"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will make the change and retest.

$(TEST_STATUS)</command>
<levels>
<level>extended</level>
Expand Down Expand Up @@ -261,7 +266,13 @@
<variation>Mode110</variation>
<variation>Mode610</variation>
</variations>
<command>$(SYSTEMTEST_CMD_TEMPLATE) -test=SharedClasses -test-args=$(Q)sharedClassMode=SCM23,sharedClassTest=MultiThread$(Q); \
<!-- Some machines may have max user processes too low by default for this test
- e.g. see https://github.com/AdoptOpenJDK/openjdk-infrastructure/issues/1851
The command is not relevant to Windows, and ulimit cannot be modified by the Jenkins users on osx.
Max user processes option is -u in bash, -p in dash (-p is pipe size in bash, so the validity of ulimit -u is used to set the correct option). -->
<command>echo "$(PLATFORM)" | grep -q "osx\|win" || \
{ MXP_FLAG=$$(test $$(ulimit -u 2>/dev/null) $(AND_IF_SUCCESS) echo "-u" || echo "-p"); REQD_MXP=2048; if [ ! "$$(ulimit $$MXP_FLAG)" = "unlimited" ] $(AND_IF_SUCCESS) [ ! $$(ulimit $$MXP_FLAG) -gt $$REQD_MXP ]; then echo Attempting to increase max user processes from $$(ulimit $$MXP_FLAG) to $$REQD_MXP; ulimit $$MXP_FLAG $$REQD_MXP; echo max user processes now $$(ulimit $$MXP_FLAG); fi; }; \
$(SYSTEMTEST_CMD_TEMPLATE) -test=SharedClasses -test-args=$(Q)sharedClassMode=SCM23,sharedClassTest=MultiThread$(Q); \
$(TEST_STATUS)</command>
<levels>
<level>extended</level>
Expand Down