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

Handle missing classes.jar in sharedClassesTestData #162

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

annaibm
Copy link
Contributor

@annaibm annaibm commented Dec 2, 2024

  • ensure the presence of classes.jar , if doesnt exist regenerate it.

resolves: eclipse-openj9/openj9#19582

@annaibm
Copy link
Contributor Author

annaibm commented Dec 2, 2024

Grinder runs:
Before change

Using Mode NoOptions. Values = ''
10:51:59  GEN /home/jenkins/testDependency/system_lib/sharedClassesTestData/v1/jdk11 exists

After change:

GEN 09:41:45.326 - Using Mode NoOptions. Values = ''
12:41:45  GEN /home/jenkins/testDependency/system_lib/sharedClassesTestData/v1/jdk11 exists but classes.jar does not exist

FileRef sharedClassesJar = sharedClassesDataDir.childFile("classes.jar");
if (sharedClassesJar.exists()) {
System.out.println(sharedClassesDataDir.getSpec() + " exists and contains classes.jar");
found = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

break the loop if found

Comment on lines 212 to 213
Path sharedClassesDataDirPath = sharedClassesDataDir.asJavaFile().toPath();
removeAllContentsAndDeleteDir(sharedClassesDataDirPath);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need line 212 and 213?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These lines were added to ensure that the directory sharedClassesDataDir and all its contents are deleted before proceeding with the creation of source files and classes.jar.Otherwise it was resulting in an exception as shown below:

https://hyc-runtimes-jenkins.swg-devops.com/job/Grinder/45365/consoleFull

Generating jar files in /home/jenkins/testDependency/system_lib/sharedClassesTestData/v1/jdk11
11:45:36  CSC 02/12/24 08:45:36: Creating source files
11:45:36  CSC stderr Exception in thread "main" java.lang.RuntimeException: Failed to create destination directory for source files
11:45:36  CSC stderr 	at net.openj9.test.sc.JavaGen.makeJavas(JavaGen.java:132)
11:45:36  CSC stderr 	at net.openj9.test.sc.JavaGen.go(JavaGen.java:100)
11:45:36  CSC stderr 	at net.openj9.test.sc.JavaGen.main(JavaGen.java:94)
11:45:36  STF 08:45:36.289 - **FAILED** Process CSC ended with exit code (1) and not the expected exit code/s (0)
11:45:36  STF 08:45:36.289 - Monitoring Report Summary:

Thinking it might be due to corrupt or residual files already present in the directory.

@annaibm annaibm requested a review from llxia December 4, 2024 14:48
System.out.println(sharedClassesDataDir.getSpec() + " exists");
FileRef sharedClassesJar = sharedClassesDataDir.childFile("classes.jar");
if (sharedClassesJar.exists()) {
System.out.println(sharedClassesDataDir.getSpec() + " exists and contains classes.jar");
found = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

please break here

@llxia
Copy link
Contributor

llxia commented Dec 4, 2024

In PR description, please change the keyword related to resolves

}
break;
} else {
System.out.println(sharedClassesDataDir.getSpec() + " exists but classes.jar does not exist");
Copy link
Contributor

Choose a reason for hiding this comment

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

Change it to sharedClassesDataDir.getSpec() + "/classes.jar does not exist.

- ensure the presence of classes.jar , if doesnt exist regenerate it.

resolves: eclipse-openj9/openj9#19582

Signed-off-by: Anna Babu Palathingal <[email protected]>
Copy link
Contributor

@llxia llxia left a comment

Choose a reason for hiding this comment

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

LGTM

@annaibm annaibm marked this pull request as ready for review December 4, 2024 17:55
@karianna karianna merged commit e4b27b7 into adoptium:master Dec 5, 2024
1 check passed
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.

SharedClasses.SCM01.SingleCL UnsupportedClassVersionError
3 participants