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

Start/stop agent with every vm/jdwp test #6044

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Haroon-Khel
Copy link
Contributor

@Haroon-Khel Haroon-Khel commented Mar 13, 2025

ref https://adoptium.slack.com/archives/C024CQ8SV7D/p1741793994007659

jck-jdwp-test-drive.sh has only the stuff from agent-drive.sh that we need.

I dont know how exactly the below steps would look but they should go in jck-jdwp-test-drive.sh line 40

cp generated.jtb temp_jdwp.jtb
Replace tests=vm/jdwp line with tests=<TEST_CASE>

I think ive got the start/stop agent steps right, I mimicked what

startJCKAgent "$1"
does as I believe that is what the original EXEC_RUNTIME_TEST_WITH_AGENT does

find $4 -type f -name "*.java" will display all of the test files in $ (JCK_ROOT)/JCK-runtime-$(JCK_VERSION_NUMBER)/tests/vm/jdwp/

startJCKAgent
# cp generated.jtb temp_jdwp.jtb
# Replace tests=vm/jdwp line with tests=<TEST_CASE>
# Not sure what to do here ^^
Copy link
Contributor

Choose a reason for hiding this comment

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

EXEC_RUNTIME_TEST will contain @$(REPORTDIR)/generated.jtb
you will need to probably use a new EXEC_RUNTIME_TEST_JDWP that does not have @$(REPORTDIR)/generated.jtb, and pass the generated.jtb as another param to this script... then use that as the basis of the cp generated.jtb...
then add the temp.jtb to the end of each EXEC... ie.

startJCKHarness "$2" @temp.jtb

startTNameServ "$2"
startJCKHarness "$3"
harnessExitCode=$?
stopTNameServ
Copy link
Contributor

Choose a reason for hiding this comment

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

No need for start/stopTNameServ

jck/jck.mk Outdated
@@ -174,6 +174,7 @@ EXEC_RUNTIME_TEST = $(JAVA_TO_TEST) -jar $(JCK_ROOT)/JCK-runtime-$(JCK_VERSION_N
EXEC_COMPILER_TEST = $(JAVA_TO_TEST) -jar $(JCK_ROOT)/JCK-compiler-$(JCK_VERSION_NUMBER)/lib/javatest.jar -config $(CONFIG_ALT_PATH)/$(JCK_VERSION)/compiler.jti @$(REPORTDIR)/generated.jtb
EXEC_DEVTOOLS_TEST = $(JAVA_TO_TEST) -jar $(JCK_ROOT)/JCK-devtools-$(JCK_VERSION_NUMBER)/lib/javatest.jar -config $(CONFIG_ALT_PATH)/$(JCK_VERSION)/devtools.jti @$(REPORTDIR)/generated.jtb
EXEC_RUNTIME_TEST_WITH_AGENT = $(TEST_ROOT)/jck/agent-drive.sh '$(START_AGENT_GENERIC)' '$(EXEC_RUNTIME_TEST)'
EXEC_RUNTIME_TEST_JDWP = $(TEST_ROOT)/jck/jck-jdwp-test-drive.sh '$(START_AGENT_GENERIC)' '$(EXEC_RUNTIME_TEST)' '$(JCK_ROOT)/JCK-runtime-$(JCK_VERSION_NUMBER)/tests/vm/jdwp/'
Copy link
Contributor

Choose a reason for hiding this comment

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

Will need to separate @$(REPORTDIR)/generated.jtb from '$('$(EXEC_RUNTIME_TEST)')'
so create a new EXEC_RUNTIME_TEST_JDWP

# Replace tests=vm/jdwp line with tests=<TEST_CASE>
# Not sure what to do here ^^
startTNameServ "$2"
startJCKHarness "$3"
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to have a hard process timeout on the testcase run in case it hangs... as we know the jtharness does not time it out...
Try adding logic like this, note needs to work for all platforms... :

${startJCKHarness} &
pid=$!
sleep 60 # 60 second timeout
if kill -s 0 $pid 2>nul; then
    echo "Testcase ?? : Process $pid is still running after 60 seconds... killing..."
    kill -9 $pid
    harnessExitCode=124
else
    wait $pid
    harnessExitCode=$?
fi

Copy link
Contributor

Choose a reason for hiding this comment

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

Also you will need to keep the worst harnessExitCode, to exit the whole jdwp loop with a non-0 rc if one or more fails...

# Not sure what to do here ^^
startTNameServ "$2"
startJCKHarness "$3"
harnessExitCode=$?
Copy link
Contributor

@andrew-m-leonard andrew-m-leonard Mar 13, 2025

Choose a reason for hiding this comment

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

Also another complication, we need to report the status report after each jdwp testcase otherwise it will be overwritten, we could try merging the report.xml's but not sure that will work...
So maybe easiest to simply report on each after each testcase, so i think we need this after each testcase:

$(TEST_STATUS) ; 
$(GEN_SUMMARY_GENERIC) tests=???? testsuite=RUNTIME

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.

2 participants