-
Notifications
You must be signed in to change notification settings - Fork 10
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
Installation script isn't working on the Apache Pulsar project #21
Comments
Hi, Thanks for trying out iFixFlakies. When you run the installer script (bash iFixFlakies/pom-modify/modify-project.sh pulsar/), do you get anything printed out? For example, on my end, when I run the script as you specified, it prints out all the paths to modules within the project that get modified. After navigating into pulsar/, I indeed see that the various pom.xml files have been modified. When you added the plugin manually to the top-level pom.xml, did it stop building at the first module and skip the rest? It seems that the first module, buildtools, does not declare the top-level module as a parent and therefore does not inherit the plugin from it. Then, the overall build would stop at the first buildtools module and skip the rest. You would need to add the plugin to this module as well (or ultimately it probably is best to add to all modules, as the script is trying to do). |
When I run the script, I don't get anything printed out. When I tried adding the plugin manually to the top-level pom.xml, it stopped very early in the process. I've attached the complete console output. |
I run the script in a Linux environment (Ubuntu 20.04). And you are saying you do not see anything printed out, not even any error message? The script itself compiles the PomFile.java and calls it on a pom.xml. Could you try first compiling the PomFile.java (javac PomFile.java) and then running "java PomFile ifixflakies 1.0.0-SNAPSHOT edu.illinois.cs.dt.tools.fixer.CleanerFixerPlugin " to see if it would modify that pom.xml file? From your provided output, it seems to be the case of what I described earlier, where it stops early at that buildtools module that did not inherit the plugin from the top-level pom.xml you modified. You could try modifying the pom.xml under buildtools/ to include the plugin and try running again, though in general you probably just want to modify the pom.xml of all modules in the project just to be safe. |
That is correct. I successfully compiled PomFile.java.
If I try to point to it from a higher-level directory, I get this:
|
For the java command, you need to pass it the path to a pom.xml you want to modify as the last input parameter. You should only run it from within the directory where the compiled PomFile.class is (otherwise you would need to include some classpath so java would know where the class is). |
Here's what I get:
Am I passing that path to the pom.xml file correctly? |
I get the same result if I pass an absolute path, like this:
|
Sorry, my mistake, you do not pass in the path to the pom.xml as an argument but rather pipe into it as an input. In other words, could you try running this command:
|
Here are my results:
It looks like it only modified the top-level pom.xml file. |
Yes, that is expected, that command should only modify the passed in pom.xml. The modify-project.sh script actually searches for all the pom.xml files via the find command and pipes those in as inputs to the java command as a means to modify all those pom.xml files. I'm not sure why that combination of find piped to this java command does not work in your environment. You could try some loop where you find all the pom.xml files and echo each one one-by-one into this command to modify all of them. |
I was able to run the command on all of the POM files in my project via: |
I confirmed that all of the POM files in the project have been updated. Now, when I run [ERROR] Failed to execute goal edu.illinois.cs:testrunner-maven-plugin:1.0:testplugin (default-cli) on project buildtools: Execution default-cli of goal edu.illinois.cs:testrunner-maven-plugin:1.0:testplugin failed: Plugin edu.illinois.cs:testrunner-maven-plugin:1.0 or one of its dependencies could not be resolved: Could not find artifact edu.illinois.cs:ifixflakies:jar:1.0.0-SNAPSHOT in apache.snapshots (https://repository.apache.org/snapshots) -> [Help 1] (It fails again at the Pulsar Build Tools module.) |
You will need to "mvn install" the iFixFlakies project first. Also, seeing as you are moving forward in trying to run iFixFlakies on modules in this project, I think you will need to have some detected order-dependent flaky tests first. You would need to run iDFlakies (https://github.com/idflakies/iDFlakies) on the project first. |
I cloned iDFlakies and ran:
After that, I inspected the POM files and noticed that the headings were all chopped off... |
I'm not sure if that happened after running the first java file or the second one. |
Could you try resetting all the pom.xml files in the project first before running the command to see if it would still cut off parts of the pom.xml file? |
I reset the pom.xml files and ran: The pom.xml files look like they should... So, maybe I deleted parts of the pom.xml files on accident while constructing the find command. |
Oh, I see what happened... I ran a mvn command to fix the license headers, and it stripped off the top line that the PomFile tool concatenated. |
I'm going to try a bulk find/replace to insert a newline character between the end of the comment and the start of <project |
Thanks for pointing that out about PomFile changes up the existing formatting. Currently, PomFile uses built-in XML parsing and XML writing from the Java standard library, and some of of that writing inserts its own formatting rules. There is probably some option that allows us to specify a better formatting, but we'll have to look at it some more to find any such options. For now, in your specific case with pulsar, I think you can add the option -Dlicense.skip to skip the license checking. |
Thanks for the explanation.
|
Did you run both scripts to add both iDFlakies and iFixFlakies to the project? Since both work off of the same testrunner-maven-plugin, you should not run both scripts on the same file without resetting in between. In other words, in this case, you should first reset and run the commands to add the iDFlakies to the project before running the iDFlakies command to detect flaky tests. Also, I suspect you may still have not built the iFixFlakies project since it seems to be unable to find the 1.0.0-SNAPSHOT version of iFixFlakies. |
So, you're saying that I should reset the pom.xml files, run the command to insert iDFlakies into the pom.xml files, and then run Then, after that, I should reset the pom.xml files again and repeat the steps to run the iFixFlakies module. Is that right? |
Yes, except afterwards when you run the iFixFlakies part you should not need to |
Okay. It's building now. I'll let you know what happens. |
Thanks for all of the help. I really appreciate it! |
Most of the modules gave output like this:
Most of the tests in Pulsar are using the TestNG framework instead of JUnit. It ran on the Does iDFlakies currently only support JUnit tests? I'd really love to see iDFlakies find some flaky tests in Apache Pulsar. I'm a contributor to Pulsar, and flaky tests are a major problem. I think it would be a great Apache project for flaky test research because the Pulsar architecture makes it very difficult to make some tests not flaky. For example, testing timeout behavior in asynchronous messaging (which is a key aspect of Pulsar architecture) causes lots of ASYNC WAIT flaky tests. |
Unfortunately, currently iDFlakies only supports JUnit tests (mainly JUnit 4 and recently JUnit 5 tests as well). We don't have immediate plans to support TestNG, but if there is enough demand we can look into how to run TestNG tests through the testrunner and iDFlakies framework. I will note that iDFlakies classifies flaky tests detected as order-dependent or non-order-dependent due to how it runs tests in different orders. The ASYNC WAIT flaky tests you mentioned would likely be under the non-order-dependent category, and they would mainly be discovered due to numerous reruns as part of the iDFlakies process. |
Thanks for the feedback. One other detail about the flaky tests in Apache Pulsar is that they usually don't fail when the tests are run locally. It's when they're sent to the CI (which runs them with minimal resources) that we see massive failures. Some of the flaky tests have been documented here: https://github.com/apache/pulsar/issues?q=is%3Aissue+flaky+ Also, the popularity of Pulsar is greatly increasing. (It's definitely the most advanced open-source messaging framework available, and I believe that it's one of the most significant Apache projects overall.) So, this could be a great opportunity for your research to really make a difference and get some publicity. :) |
Thank you for the feedback, and thank you very much for all the links and resources on Pulsar flaky tests, those are all very interesting! It looks like something I want to look more into in detail to understand what kind of flakiness has been documented and how people are addressing them. |
Sounds good. Please let me know if I can be of any help. |
When I run the installation script for Apache Pulsar, nothing happens.
To reproduce:
Pulsar's POM files are unmodified. Verify as follows:
Also, if I try manually adding the plugin to the top-level POM file and running
mvn testrunner:testplugin
, I get this error:The text was updated successfully, but these errors were encountered: