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
bad detecting test when using super class #961
Comments
For those cases you can use the ":avocado: enable" tag in the class It's documented at: http://avocado-framework.readthedocs.org/en/latest/WritingTests.html#test-tags
|
thanks for response. |
@jscotka I'll try to reproduce the scenario you're reporting. |
should be easy. Just to have second scenario with separated classes to two files and then: ERROR (157.27 s) I'm unable to upload result log beause It has 48M :-) |
Started looking into this, I'm not able to reproduce::
Any thoughts on that? |
Now I'm baffled. I did hit that issue and now I can't reproduce it. Let me try to bisect it. |
OK, now I remember how I hit it: you have to
And then our very own fork bomb works! |
So, having the docstring tag ( |
@apahim I've written a reproducer to that bug as a functional test: https://github.com/clebergnu/avocado/tree/simple_tests_fork_bomb |
So, I actually found what is causing this, and it has very little to do with the loader. What happens is, when a test like this is run as a simple test, it basically runs in standalone mode. When it runs in standalone mode ( Then, quite obviously the loader of that new job will look at |
yep, it's what user asked for... |
Resolves avocado-framework#961 Reference: https://trello.com/c/cvl7hEOb Signed-off-by: Amador Pahim <apahim@redhat.com>
Resolves avocado-framework#961 Reference: https://trello.com/c/cvl7hEOb Signed-off-by: Amador Pahim <apahim@redhat.com>
@ldoktor replying to your last comment: do you think we should step back and leave
Make this an executable, and run it (standalone). No tests, but still generates a fork bomb. |
Well how about this approach. This code can be put into files to execute the file as avocado tests (INSTRUMENTED). How about tuning the options in the Btw my first idea was to disable |
Because the current implementation of avocado.main() creates a job and runs "sys.argv[0]" to implement standalone mode, it ends up running itself over and over. This simple proposed fix, prevents avocado.main() from running itself again if called from itself. Since they are on different processes, the mechanism chosen to do this is to set an environment variable, that will be seen by the next process. This adresses issue avocado-framework#961. Signed-off-by: Cleber Rosa <crosa@redhat.com>
Because the current implementation of avocado.main() creates a job and runs "sys.argv[0]" to implement standalone mode, it ends up running itself over and over. This simple proposed fix, prevents avocado.main() from running itself again if called from itself. Since they are on different processes, the mechanism chosen to do this is to set an environment variable, that will be seen by the next process. This adresses issue avocado-framework#961. Signed-off-by: Cleber Rosa <crosa@redhat.com>
Because the current implementation of avocado.main() creates a job and runs "sys.argv[0]" to implement standalone mode, it ends up running itself over and over. This simple proposed fix, prevents avocado.main() from running itself again if called from itself. Since they are on different processes, the mechanism chosen to do this is to set an environment variable, that will be seen by the next process. Also, by exiting from main() with an error code, the test first level test will fail. This will let the user know that the chosen approach (SIMPLE tests written in Python and calling main()) are not worthy of a PASS. This adresses issue avocado-framework#961. Signed-off-by: Cleber Rosa <crosa@redhat.com>
Because the current implementation of avocado.main() creates a job and runs "sys.argv[0]" to implement standalone mode, it ends up running itself over and over. This simple proposed fix, prevents avocado.main() from running itself again if called from itself. Since they are on different processes, the mechanism chosen to do this is to set an environment variable, that will be seen by the next process. Also, by exiting from main() with an error code, the test first level test will fail. This will let the user know that the chosen approach (SIMPLE tests written in Python and calling main()) are not worthy of a PASS. This adresses issue avocado-framework#961. Signed-off-by: Cleber Rosa <crosa@redhat.com>
Because the current implementation of avocado.main() creates a job and runs "sys.argv[0]" to implement standalone mode, it ends up running itself over and over. This simple proposed fix, prevents avocado.main() from running itself again if called from itself. Since they are on different processes, the mechanism chosen to do this is to set an environment variable, that will be seen by the next process. Also, by exiting from main() with an error code, the test first level test will fail. This will let the user know that the chosen approach (SIMPLE tests written in Python and calling main()) are not worthy of a PASS. The functional tests make use of Python's standard library utilities (subprocess module) directly for running Avocado because of current issues with Avocado's own process utility module. This adresses issue avocado-framework#961. Signed-off-by: Cleber Rosa <crosa@redhat.com>
Hi,
I had similar code like:
This code caused, that avocado dont find that it is test.
I would like to use some generic funcions in other class, so I expected that inheritance works intuitively.
In case super class is in separate file (what was my case)
"avocado run" is in unghly cycle, and probably will kill machine, because of memory exhaustion:
like:
try this test (splitted to two files)
and test2.py:
finally I had to solve by workaound, that I have multiple inheritance in testing class like: ( class BasicTestsuite(Test,SuperTest), but I expected that direct inheritance will work well.
And also this does not allow me to use setUp and tearDown methods in SuperTest class, But I have to explicitly register them in BasicTestsuite class.
The text was updated successfully, but these errors were encountered: