-
Notifications
You must be signed in to change notification settings - Fork 2
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
Build / Test Issues #2
Comments
Thanks, Andy!
|
The java -XshowSettings:properties -version 2>&1 | grep user.name gives a result, but given the directory(ies) are created based on getenv("USER"), which returns null, the post-build tests fail. The system we are running on does not have the USER environment variable set at runtime, but we will make sure to explicitly set it before any build/tests going forward. If you make a note of this potential issue it might be helpful for others, as it took me sometime to understand why some of the post-build tests were failing. |
Thanks for confirming that the user.name property exists and is reasonable. I'll update the code to use the user.name property rather than the USER environment variable, so you won't have to use that workaround forever. |
While attempting to build Ziggy in an Amazon Linux 2 container, I encountered a few issues with the build and testing phases.
java.lang.NullPointerException
at java.base/java.io.File.(File.java:318)
at gov.nasa.ziggy.module.remote.nas.NasQueueTimeMetrics.fullDestination(NasQueueTimeMetrics.java:96)
at gov.nasa.ziggy.module.remote.nas.NasQueueTimeMetrics.populate(NasQueueTimeMetrics.java:92)
at gov.nasa.ziggy.module.remote.nas.NasQueueTimeMetrics.queueDepth(NasQueueTimeMetrics.java:198)
at gov.nasa.ziggy.module.remote.nas.NasQueueTimeMetricsTest.testValues(NasQueueTimeMetricsTest.java:98)
at gov.nasa.ziggy.module.remote.nas.NasQueueTimeMetricsTest.testSmdMetrics(NasQueueTimeMetricsTest.java:76)
which is because the environmental variable "USER" may not be available, and gov/nasa/ziggy/module/remote/nas/NasQueueTimeMetrics.java (line 96) requires System.getenv("USER") to succeed, but in some environments it will not, hence the failure of these specific tests in certain environments. As an aside, some considered this approach of creating temp directories, or files, as bad practice; it can be regarded as potentially unsafe/insecure. Have you considered using something like Files.createTempDirectory?
The text was updated successfully, but these errors were encountered: