apache / accumulo-testing

Apache Accumulo Testing
https://accumulo.apache.org
Apache License 2.0
15 stars 40 forks source link

IllegalArgumentException: Rwalk Simpl.xml and Basic.xml module #213

Closed Manno15 closed 2 years ago

Manno15 commented 2 years ago

While testing some possible jar issues, I ran into an IlegalArgumentException while trying to run the Simple.xml module of rwalk. Stacktrace below:

``` java.lang.IllegalArgumentException: InputStream cannot be null at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:118) ~[?:?] at org.apache.accumulo.testing.randomwalk.Module.loadFromXml(Module.java:521) ~[accumulo-testing-shaded.jar:?] at org.apache.accumulo.testing.randomwalk.Module.(Module.java:194) ~[accumulo-testing-shaded.jar:?] at org.apache.accumulo.testing.randomwalk.Framework.getNode(Framework.java:79) ~[accumulo-testing-shaded.jar:?] at org.apache.accumulo.testing.randomwalk.Framework.run(Framework.java:53) ~[accumulo-testing-shaded.jar:?] at org.apache.accumulo.testing.randomwalk.Framework.main(Framework.java:98) ~[accumulo-testing-shaded.jar:?] 2022-08-07T12:57:31,481 [testing.randomwalk.Framework] ERROR: Error during random walk java.lang.Exception: Failed to parse xml at randomwalk/modules/Simple.xml at org.apache.accumulo.testing.randomwalk.Module.loadFromXml(Module.java:524) ~[accumulo-testing-shaded.jar:?] at org.apache.accumulo.testing.randomwalk.Module.(Module.java:194) ~[accumulo-testing-shaded.jar:?] at org.apache.accumulo.testing.randomwalk.Framework.getNode(Framework.java:79) ~[accumulo-testing-shaded.jar:?] at org.apache.accumulo.testing.randomwalk.Framework.run(Framework.java:53) ~[accumulo-testing-shaded.jar:?] at org.apache.accumulo.testing.randomwalk.Framework.main(Framework.java:98) ~[accumulo-testing-shaded.jar:?] 2022-08-07T12:57:31,481 [testing.randomwalk.Framework] INFO : Test finished ```

I am currently still investigating but creating the issue in case someone wants to take a stab at it.

Current commit: https://github.com/apache/accumulo-testing/commit/ea659deaeacb46a4b22d4844f52e92b9508302fb and using latest accumlo-2.1 (though seems unrelated).

Manno15 commented 2 years ago

Seems this issue is rather simple. Running just ./bin/rwalk Simple.xml looks for the module inside randomwalk/modules/ whereas it is actually located inside randomwalk/modules/unit/. Running the same rwalk command but with unit/Simple.xml runs as expected. This also holds true for the Basic.xml module. Module.java should be updated to look for modules also inside the unit directory. Other possible solutions could be to move those two modules in unit/ into modules/ or specify in the help for of rwalk that unit/ needs to be included for these two specific modules

Manno15 commented 2 years ago

Below is the code snippet that looks for the module that the user specified to be run.

https://github.com/apache/accumulo-testing/blob/da4a4343d738f4861d7109290d3618f0a09c93b8/src/main/java/org/apache/accumulo/testing/randomwalk/Module.java#L519-L524

DomGarguilo commented 2 years ago

I'm not certain of the intentions behind these files in the unit directory (Basic and Simple), but it doesn't seem to me that these are necessarily supposed to be run on their own by the user. Instead they seem like components of the other randomwalk modules/tests.

Manno15 commented 2 years ago

Yes, but they still show up as options for the user to choose if you enter the rwalk command without any module.

DomGarguilo commented 2 years ago

Yes, but they still show up as options for the user to choose if you enter the rwalk command without any module.

Oh yea good point. I didn't see that until now. Maybe in that list those two can be prefixed with /unit

DomGarguilo commented 2 years ago

Adding -maxdepth 1 to the find command here: https://github.com/apache/accumulo-testing/blob/ae9c46552a661c2dec132d26835cec5dd2ecbf66/bin/rwalk#L31 will make it so that Basic.xml and Simple.xml are not shown on the list of available options in the rwalk help printout.

Not sure if this is a solution or if it would be better to make it so that the user is able to run Basic.xml and Simple.xml