Skip to content

Commit

Permalink
[Misc] fix TestParGCAllocatorLeak.sh run fail on ubuntu
Browse files Browse the repository at this point in the history
Summary: By default in ubuntu system, sh points to dash, which causes sh use array to report an syntax error. Relate testcase: hotspot/test/multi-tenant/TestParGCAllocatorLeak.sh

Test Plan: CI pipeline

Reviewed-by: jeffery.wsj, lvfei.lv

Issue: #408
  • Loading branch information
sendaoYan committed Sep 27, 2022
1 parent 9642abd commit b0b8f7d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions hotspot/test/multi-tenant/TestParGCAllocatorLeak.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ fi
set -x

${JAVA} -cp . -XX:+UseG1GC -XX:+MultiTenant -XX:+TenantHeapIsolation -XX:NativeMemoryTracking=detail -XX:+PrintGCDetails -Xloggc:gc.log -Xmx1g -Xmn32m ${TEST_CLASS} > ${TEST_CLASS}.log 2>&1 &
PID=$!
sleep 5
PID=$(ps ax | grep ${TEST_CLASS} | grep -v grep | awk '{print $1}')
if [ -z "$PID" ] && [ "$(echo $PID | wc -w)" -gt 1 ] ; then
echo "BAD pid!"
exit 1
Expand All @@ -104,9 +104,7 @@ $JCMD $PID VM.native_memory baseline
sleep 30

# check differences of below sections
NMT_SECTIONS=("Internal" "Tenant")

for MEM_SEC in ${NMT_SECTIONS[*]}; do
for MEM_SEC in `echo Internal Tenant`; do
DIFF=$($JCMD $PID VM.native_memory summary.diff | grep -A3 ${MEM_SEC} | grep malloc | grep -v grep)
if [ ! -z "$(echo $DIFF | grep +)" ] && [ -z "$(echo $DIFF | awk '{print $2}' | grep \#)" ]; then
DIFF=$(echo $DIFF | awk '{print $2}')
Expand Down

0 comments on commit b0b8f7d

Please sign in to comment.