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

Failing test cases through maven #140

Closed
ayushsingh01042003 opened this issue Mar 25, 2024 · 3 comments
Closed

Failing test cases through maven #140

ayushsingh01042003 opened this issue Mar 25, 2024 · 3 comments

Comments

@ayushsingh01042003
Copy link
Contributor

We have 3 errors on running the test cases through maven.

To Reproduce
Steps to reproduce the behavior:

  1. After we get a "BUILD SUCCESS" message on running mvn compile
  2. Run the command mvn package in webapps/erddap

This should result in the following error message

[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   HashDigestTests.basicTest:21 » Runtime 
ERROR in Test.ensureEqual(Strings) line #1, col #1 '3[end]'!='9[end]':
Specifically, at line #1, col #1:
s1: 327fbb2aa6c6297d4fdd5fdf4b14e289[end]
s2: 96e9b4d974b734874a66f433b276a41a[end]
    ^

[ERROR]   NcHelperTests.testUnlimited:578 » FileNotFound /temp/unlimited.nc (No such file or directory)
[ERROR]   TableTests.testReadOpendapSequenceSpeed:2715 Simple readOpendapSequence took too long (time=2461ms).
[INFO] 
[ERROR] Tests run: 57, Failures: 0, Errors: 3, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:01 min
[INFO] Finished at: 2024-03-25T20:46:00+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.2.1:test (default-test) on project ERDDAP: 
[ERROR] 
[ERROR] Please refer to /usr/local/Tomcat/webapps/erddap/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.

@jcermauwedu
Copy link
Contributor

Somehow the MD5 and SHA256 hashes changed on the file or the new hashes were incorrect when updated.
app/target/classes/com/cohort/util/LICENSE.txt

I don't see it being updated in the history log for LICENSE.txt. For HashDigestTests.java, there was a note indicating that the tests were moved around and that the hashing algorithm had changed. See: 7bab64c

Using an interactive development docker container:

root@e03e51ee62d1:/app# md5sum target/classes/com/cohort/util/LICENSE.txt
327fbb2aa6c6297d4fdd5fdf4b14e289  target/classes/com/cohort/util/LICENSE.txt
root@e03e51ee62d1:/app# sha256sum target/classes/com/cohort/util/LICENSE.txt
e376c88953b2d56b00783fed071f1875e8ed94230f4e14eee5bce8bd608de5e6  target/classes/com/cohort/util/LICENSE.txt

I get the same hash for MD5 as @ayushsingh01042003 as seen above.

If you fix the MD5 hash, the SHA256 will fail next. Once the hashes are updated, I get a build success using:

# mvn -f pom.xml package

No other tests fail for me.

@ChrisJohnNOAA
Copy link
Contributor

I wonder if the license.txt hash issue is related to git behavior on different systems (it can convert line endings on checkout and on commit automatically to make files match what is expected by your OS). This would lead to Linux machines potentially having a different hash for a txt file than a Windows system.

For the NcHelperTests.testUnlimited error, that seems to be a hardcoded path I missed updating previously. I'm fixing that as part of my next update to the maven tests.

For TableTests.testReadOpendapSequenceSpeed, there's no real error there. There probably should not be asserts for time taken because what's good on one machine may be slow on another. Additionally, with the change to using JUnit for testing (instead of the old approach), tests can now be run in parallel. The time based asserts were often set assuming there were no other significant stresses on the system (like other tests).

@ChrisJohnNOAA
Copy link
Contributor

I believe this has been fixed with the merge of #142

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