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
Some unit tests are failing in certain machine environments (OS, Maven and Java versions) #764
Comments
I don't know if here is the correct local to report this, but Travis Ci Build of VRaptor project is failed. |
Sorry, now is passing. 😃 |
I think we having some problems with VRaptor tests or Travis Ci, since sometimes the travis ci build is failed also on github VRaptor4 project, not only in some environments. And always the the test brokes on What do you think ? @Turini @lucascs @garcia-jj |
yes, this is the reason we open the issue :) |
So we probably have an implicit order dependency that makes the test fail. "You shouldn't add more interceptors after ordering. Please notify vraptor developers." It seems like a VRaptor 3 inheritance. Which class is throwing this? |
@lucascs, the problem occurs on CDIBasedContainerTest class. |
I mean the class that is throwing |
True, sorry @lucascs. The class is |
Testing using eclipse, If we run |
So, this class should be re-initialized on CDIBasedContainerTest: |
@lucascs we need call |
No, reinitialize it on CDI. It seems that that class is being shared between test cases... put a println or breakpoint on TopologicalSortedInterceptorRegistry's constructor and see how many times it is called during a test run. |
@lucascs 14 times. |
@lucascs how can I reinitialize it ? |
this 14 times is only running the CDIxxxTest? or the whole src/test/java folder? try to start |
14 times in the whole src/test/java folder. I'll try it. |
@lucascs If I start |
we should to start the container one single time for all tests |
Just a note: In older versions I didn't have these errors. IMHO this issue is too important, since new committers may got these errors and may discourage them to commit. Also sometimes the Travis Ci Build on VRaptor github page is failing, and doesn't sounds good, especially for new users. |
To avoid flooding, you can add all text you want in the same comment. So we |
Sorry. I did that beause I just remembered after I wrote the other comment. |
@Turini why instantiating only one container? what about applicationScoped components? |
Since So, here is thrown the message: Or am I wrong ? |
This bug is related to the order of execution of the tests. |
That's strange because we are using junit 4.11 and the test execution order Maybe the order of the classes are being mixed up by surefire (since we are I think that if Renato send us the full output of mvn test we can discover Anyway, depending on the test execution order is always bad, I think the Chico Sokol On Wed, Sep 3, 2014 at 9:58 PM, Renato R. R. de Oliveira <
|
sorry my delay guys
the idea is to start the container each test? why we should do that?
sorry, I didn't get the point... starting and shutting down the weld |
this is true... if our tests are broken because of order, we should fix it |
I see that we're using a custom runner to start Weld and inject dependencies. I think it's usually better to use a library where possible, instead of reimplementing it. In this case, I think we're reimplementing CDI-Unit (http://jglue.org/cdi-unit/). What do you think of using it instead of maintaining our own JUnit runner? Maybe this will solve the problem. |
Sounds like good to me. I'll try to push a branch today using CDI-unit to test it (and the instabilities problems). Thks @luiz |
Travis are bothering us. What you think to restart CDI container on each test (as @renanigt suggested) until we can fix this case? So Travis will like a charm, slow, but all tests will pass. |
I'll try to fix this issue again (I think now I understand whats happening here). |
Only a note: I see the last change works, but from now tests are too slow. This is not a big problem. |
@renanigt it still failing on your machine? anyone else? |
Yes @Turini. =/ |
I think we can close here, at least until someone else report the same |
Since it's too specific, I agree with you @Turini. Today I can take a look in this problem and try to fix it. |
Thank you @renanigt. |
In some cases, some unit tests are failing.
This failure occurs even on some Travis CI builds.
The result output for the error is:
Results :
Tests in error:
Some "mvn -V" outputs where the errors occurs:
The "mvn -V" output where the error don't occurs:
The text was updated successfully, but these errors were encountered: