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

Added churn testsuite #5101

Merged
merged 17 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
14 changes: 14 additions & 0 deletions functional/churn/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# churn
Test targeting garbage collector(s)

## Running churn locally
clone https://github.com/rh-openjdk/churn read https://github.com/rh-openjdk/churn/blob/master/README and run run.sh

### Setting up the environment:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
### Setting up the environment:
### Setting up the environment

Java required. Maven recommended, churn can be compiled via direct javac if needed.
Java is used from JAVA_HOME or guessed from PATH
run.sh can use OTOOL_garbageCollector and OTOOL_JDK_VERSION instead of gc argument. See https://github.com/rh-openjdk/churn/blob/master/README for details

### Executing the testsuite
Now it is as simple as running bash script run.sh.

64 changes: 64 additions & 0 deletions functional/churn/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0"?>

<!--
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-->

<project name="churn" default="build" basedir=".">
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<description>
Test of correct behavior of swing components in both headful and headless jre environment.
judovana marked this conversation as resolved.
Show resolved Hide resolved
</description>

<!-- set properties for this build -->
<property name="TEST" value="churn" />
<property name="DEST" value="${BUILD_ROOT}/functional/churn" />
<property name="src" location="./churn" />

<target name="THC.check">
Copy link
Contributor

Choose a reason for hiding this comment

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

Opportunity to generalize the name to testcodeDir.check and testCodeDir.exists (which could also be made into an ant macrodef and moved to TKG, but not required for this PR), no need to use same ant target name as the TestHeadlessComponents ant tasks

<condition property="THCdir.exists">
<available file="churn" type="dir"/>
</condition>
</target>

<if>
<contains string="${SPEC}" substring="zos"/>
<then>
<property name="GIT_REPO" value="[email protected]:" />
</then>
<else>
<property name="GIT_REPO" value="https://github.com/" />
</else>
</if>

<target name="getChurn" depends="THC.check" unless="THCdir.exists">
<exec executable="git" failonerror="true">
<arg value="clone" />
<arg value="${GIT_REPO}rh-openjdk/churn.git" />
</exec>
</target>

<target name="init">
<mkdir dir="${DEST}"/>
</target>

<target name="dist" depends="getChurn" description="generate the distribution">
<copy todir="${DEST}">
<fileset dir="${src}" includes="*.xml, *.mk"/>
</copy>
</target>

<target name="build">
<antcall target="dist" inheritall="true" />
</target>
</project>
67 changes: 67 additions & 0 deletions functional/churn/playlist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version='1.0' encoding='UTF-8'?>
<!--
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-->
<playlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../TKG/resources/playlist.xsd">
<test>
<testCaseName>churn</testCaseName>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest calling it churnGC_5min and creating a 2nd testTargetName called churnGC_4hr and setting the DURATION accordingly for both.

<!-- export DURATION=18000 ; \-->
<command>
export OTOOL_JDK_VERSION=$(JDK_VERSION) ; \
export JREJDK="jdk" ; \
export OTOOL_garbageCollector=ALL ; \
export DURATION=24 ; \
export TMPRESULTS=$(Q)$(REPORTDIR)$(D)report$(Q); \
cd $TMPRESULTS ; \
bash $(TEST_ROOT)$(D)functional$(D)churn$(D)churn$(D)run.sh; \
$(TEST_STATUS)
</command>
<levels>
<level>dev</level>
</levels>
<platformRequirementsList>
<platformRequirements>os.linux</platformRequirements>
<platformRequirements>os.win</platformRequirements>
<platformRequirements>os.osx</platformRequirements>
</platformRequirementsList>
<groups>
<group>functional</group>
judovana marked this conversation as resolved.
Show resolved Hide resolved
</groups>
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's restrict to particular vendors for now, as I am not sure which vendors include the entire list of GCs that are in 'allGCs' in their distribution (in particular shenandoah) and we do not want to break others.
Add this bit into the <test> block, can be right after the </groups> tag

<vendors>
        <vendor>eclipse</vendor>
        <vendor>redhat</vendor>
</vendors>

</test>
<test>
<testCaseName>churn-nocoops</testCaseName>
Copy link
Contributor

Choose a reason for hiding this comment

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

We already have a mechanism to automatically run all test targets twice, once with compressedrefs JVM option, and a second time as noncompressedrefs JVM option.

I have to look closer at what NOCOMP does in the churn code, is it used for other decision-making within the test code to best advise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is propagating it to the logs name on top level - https://github.com/rh-openjdk/churn/blob/master/run.sh#L155, and setting the appropriate flags on the low level - https://github.com/rh-openjdk/churn/blob/master/bin/nocoops.sh

<!-- export DURATION=18000 ; \-->
<command>
export NOCOMP=-nocoops ; \
export OTOOL_JDK_VERSION=$(JDK_VERSION) ; \
export JREJDK="jdk" ; \
export OTOOL_garbageCollector=ALL ; \
export DURATION=24 ; \
export TMPRESULTS=$(Q)$(REPORTDIR)$(D)report$(Q); \
cd $TMPRESULTS ; \
bash $(TEST_ROOT)$(D)functional$(D)churn$(D)churn$(D)run.sh; \
$(TEST_STATUS)
</command>
<levels>
<level>dev</level>
</levels>
<platformRequirementsList>
<platformRequirements>os.linux</platformRequirements>
<platformRequirements>os.win</platformRequirements>
<platformRequirements>os.osx</platformRequirements>
</platformRequirementsList>
<groups>
<group>functional</group>
</groups>
</test>
</playlist>