In order to have the results of running automated tests be stable and predictable, you will need to follow the guidelines below.
These guidelines may evolve as things evolve on new versions of the platforms.
First some more general gudelines :
The jtreg framework runs all the tests and these are run in othervm mode for all client tests - as specified in TEST.ROOT
# Tests that must run in othervm mode
othervm.dirs=java/awt java/beans javax/accessibility javax/imageio javax/sound javax/swing javax/print \
com/apple/laf com/sun/java/accessibility com/sun/java/swing sanity/client demo/jfc \
javax/management sun/awt sun/java2d javax/xml/jaxp/testng/validation java/lang/ProcessHandle
If you create a new top-level directory for client tests ie directly under test/jdk, then add that directory to the othervm.dirs list.
If a test requires access to the desktop - ie creates a window etc such that it is a "headful" task then "@key headful" needs to be added.
"@key printer" should be added to tests that expect a printer
These can then be used when filtering which tests to run. For example
make -- test TEST_JOBS=1 TEST="jtreg:jdk_desktop" JTREG='VERBOSE=summary;KEYWORDS=headful&!printer;RETRY_COUNT=2'
Will run just the headtul tests and exclude headless ones. Or you can do vice versa. RETRY_COUNT means that any test that fails should be retried. Sadly this is quiteuseful as headful tests can sometimes be sensitive to timing etc. These probably indicate a test stability issue but RETRY helps you be more sure of that without needing to re-run the entire task. It should also be obvious that you don't touch your keyboard or mouse whilst these are running and that TEST_JOBS=1 is pointing out that headful tests can't be running concurrently and fighting over input focus etc.