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

HCRLateAttachWorkload test times out on Windows on JDK8 OpenJ9 #236

Closed
Mesbah-Alam opened this issue Mar 23, 2019 · 5 comments
Closed

HCRLateAttachWorkload test times out on Windows on JDK8 OpenJ9 #236

Mesbah-Alam opened this issue Mar 23, 2019 · 5 comments
Assignees
Milestone

Comments

@Mesbah-Alam
Copy link
Contributor

HCRLateAttachWorkload test times out on Windows on JDK8 OpenJ9

LT  02:32:23.429 - Test stopped due to reaching runtime limit
LT  02:32:23.429 - Load test completed
LT  02:32:23.429 -   Ran     : 5333
LT  02:32:23.429 -   Passed  : 5333
LT  02:32:23.429 -   Failed  : 0
LT  02:32:23.429 -   Result  : PASSED
STF 02:37:20.165 - Heartbeat: Process AG  is still running
STF 02:37:22.227 - **FAILED** Process AG  has timed out

https://ci.eclipse.org/openj9/job/Test-extended.system-JDK8-win_x86-64_cmprssptrs/205/tapResults/

@Mesbah-Alam
Copy link
Contributor Author

Mesbah-Alam commented Mar 26, 2019

Running 5x Grinder fails : https://ci.adoptopenjdk.net/view/Test_grinder/job/Grinder-systemtest/75/console

The Process "AG" seems to "hang" - even after increasing the timeout to 30m, the test has still been failing.

Looking into the test code, AG is the process that runs the Attacher.

Running another grinder with more debug info in the Attacher class: https://ci.adoptopenjdk.net/view/Test_grinder/job/Grinder-systemtest/77/console

@Mesbah-Alam Mesbah-Alam self-assigned this Mar 26, 2019
@Mesbah-Alam
Copy link
Contributor Author

Mesbah-Alam commented Mar 27, 2019

On Linux, the test finds a VM to attach to whose PID matches that of the passed on PID:

AG  7:45:27 > Debug: vmPidArg   = 6968
10:50:06  AG  7:45:27 > Debug: oneVM.id() = 6968
10:50:06  AG  7:45:27 > Debug: Found target vm!

https://ci.adoptopenjdk.net/view/Test_grinder/job/Grinder-systemtest/80/console

However, on Wndows, there is no match found with the passed in PID with the PID of the available VMs:

 AG  15:14:30 > Debug: vmPidArg   = 260
11:14:30  AG  15:14:30 > Debug: oneVM.id() = 7120
11:14:30  AG  15:14:30 > Debug: vmPidArg   = 260
11:14:30  AG  15:14:30 > Debug: oneVM.id() = 9020
11:14:30  AG  15:14:30 > Debug: Sleeping while waitinhg for target VM to become available..
11:14:32  AG  15:14:31 > Debug: vmPidArg   = 260
11:14:32  AG  15:14:31 > Debug: oneVM.id() = 7120
11:14:32  AG  15:14:31 > Debug: vmPidArg   = 260
11:14:32  AG  15:14:31 > Debug: oneVM.id() = 9020
11:14:32  AG  15:14:31 > Debug: Sleeping while waitinhg for target VM to become available..
11:14:32  AG  15:14:32 > Debug: vmPidArg   = 260
11:14:32  AG  15:14:32 > Debug: oneVM.id() = 7120
11:14:32  AG  15:14:32 > Debug: vmPidArg   = 260
11:14:32  AG  15:14:32 > Debug: oneVM.id() = 9020

https://ci.adoptopenjdk.net/view/Test_grinder/job/Grinder-systemtest/81/console

Hence, on Windows, the test "hangs" inside the Attacher while loop.

@Mesbah-Alam
Copy link
Contributor Author

Mesbah-Alam commented Mar 27, 2019

The vmPidArg value that the Attacher receives from the test comes from

JavaProcessDefinition testProcess2 = test.createJavaProcessDefinition() 
				.addJarToClasspath(agentJar)
				.addJarToClasspath(toolsJar)
				.runClass("net.adoptopenjdk.test.hcrAgent.agent.Attacher")
				.addPerlProcessData(miniMixProcess,StfConstants.PERL_PROCESS_PID)
				.addArg(agentJar.toString())
				.addArg(agentOptions);

Where

.addPerlProcessData(miniMixProcess,StfConstants.PERL_PROCESS_PID) - return 6968 on Linux, and 260 on Windows.

These integers are generated in JavaProcessDefinition.java, here:

/**
	 * Adds another process' perl variable to the Java invocation as an argument value, plus a suffix that tells it to return data we want.
	 * @param process is the StfProcess object whose data we want.
	 * @param perlProcessDataIndex is the number of the Perl process variable add-on that returns the data we want. 
	 *                             e.g. Passing 1 would result in "$processVariableName->{pid}", which would tell the 
	 *                             perl variable representing a process to return the process id.
	 * @return the updated JavaProcessDefinition.
	 * @throws StfException if this method is called out of sequence, or if that perlProcessDataKey doesn't exist inside 
	 * 						the PERL_PROCESS_DATA constant HashMap.
	 */
	public JavaProcessDefinition addPerlProcessData(StfProcess process, Integer perlProcessDataKey) throws StfException {
		checkAndUpdateLevel(Stage.APPLICATION_ARGS);

		if (process != null) {
			//First we check to see if this a
			if (!StfConstants.PERL_PROCESS_DATA.containsKey(perlProcessDataKey)) {
				throw new StfException("PERL_PROCESS_DATA does not contain key " + perlProcessDataKey);
			}
			//Then we add this process to the list of processes.
			String processKey = "Nonconstant_Placeholder_For_Perl_Code_That_Retrieves_Process_Data" + this.relatedProcesses.size() + ";";
			this.relatedProcesses.put(processKey,process); 
			this.relatedProcessesData.put(processKey, perlProcessDataKey);
			//Then we add a placeholder to the list of arguments, to retain the correct argument order.
			addArg(processKey);
		}
		
		return this;
	}

@Mesbah-Alam
Copy link
Contributor Author

@lumpfish - do you know if this test ever worked on Windows?

JavaProcessDefinition#addPerlProcessData() doesn't seem to be doing what it's supposed to do on Windows (it works on non-Windows platforms).

@lumpfish
Copy link
Contributor

lumpfish commented Nov 9, 2020

This is fixed by adoptium/STF#89

Created PR to reinstate the tests: adoptium/aqa-tests#2046

@karianna karianna added this to the November 2020 milestone Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants