-
Notifications
You must be signed in to change notification settings - Fork 343
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
nrunner seems to not cleanup properly on timeout #5407
Comments
@kraxel thanks for reporting this issue. Interrupting the test and then moving the execution to the same (test) instance
Bear in mind that option two currently has a number of shortcomings, but we intend to make it no different from a local test execution. Would you, as a developer/user, fancy one over the other? |
option two shortcoming #1 -- seems to not be documented very well. Is there something more useful the object reference (which doesn't tell me how I can use it) ? Without that it's hard to judge. From a design point of view running inside a container and leave the cleanup to the container runtime makes sense to me. What are the known shortcomings? How does the podman spawner handle networking? I have some tests which create an isolated network namespace, then hook up dhcp, dns, tftp, http and qemu to that namespace for network boot testing. Can that be done with the podman spawner? Or maybe I don't have to create a network namespace myself then because podman creates one for the container anyway? |
True. We do expect to make this more visible as it grows in capabilities. Expect an update to the documentation shortly. Anyway, right now the podman spawner is only visible by doing:
And the usage message is available when running
There may be many shortcomings, some inherent from the container technology itself, and some from Avocado's use of the technology. Its strengths when paired with Avocado, on the other hand, include:
The communication between Avocado running the job (and spawning tests in a container) and the actual "avocado-runner-*" running the test inside the container are not dependent on networking proper (that's the short answer). So it should be possible to use any of the podman networking capabilities, including its own isolated network namespace indeed. Avocado currently doesn't allow control over the networking options for the podman container it creates, but that's an easy fix. In short, Avocado is betting that container based workloads make a lot of sense for functional/integration testing, so a lot of new features are being developed with this mindset. One example of a very cool feature under development is this. Long story short, all the dependencies in a test will be attempted to be fulfilled transparently in the environment they are running (including podman containers), and those environments will be cached for future use. If you need to install packages, download files (and more to come) for your test to run successfully, you just need to describe them in the test. Example: from avocado import Test
from avocado.utils import process
class TFTP(Test):
"""
avocado: dependency={"type": "package", "name": "tftp-server"}
"""
def test(self):
self.log.info(process.run("in.tftpd --version")) On first run, Avocado will prepare the container images. On subsequent runs, Avocado will just reuse them. Let me know if that sounds valuable and an extra incentive to investigate the use option two with the edk2 tests. |
In order to move this issue forward, I'll attempt to run the e2dk tests (and examples given in the issue description) with the podman spawner. |
You might want revert 9c79f0c5ddacc172bca8b1d86c384614672a5423 then. |
It introduces SIGTERM handling in avocado-instrumented tests to run a tearDown method when the test has been interrupted. It uses functionality from Test class, which already handles interruptions. It only adds a monitoring loop to send all messages created by tearDown to avocado core. Reference: avocado-framework#5707 avocado-framework#5407 Signed-off-by: Jan Richter <[email protected]>
It introduces SIGTERM handling in avocado-instrumented tests to run a tearDown method when the test has been interrupted. It uses functionality from Test class, which already handles interruptions. It only adds a monitoring loop to send all messages created by tearDown to avocado core. Reference: avocado-framework#5707 avocado-framework#5407 Signed-off-by: Jan Richter <[email protected]>
It introduces SIGTERM handling in avocado-instrumented tests to run a tearDown method when the test has been interrupted. It uses functionality from Test class, which already handles interruptions. It only adds a monitoring loop to send all messages created by tearDown to avocado core. Reference: avocado-framework#5707 avocado-framework#5407 Signed-off-by: Jan Richter <[email protected]>
Describe the bug
nrunner seems to not call tearDown() when a testcase times out
Steps to reproduce
I have testcases which need some background processes.
They are started by the testcase like this:
And are stopped this way:
Expected behavior
When the test is done tearDown() is called for cleanup.
Current behavior
When the test case times out (result 'INTERRUPTED') tearDown() is apparently not called,
so I sometimes have leftover processes hanging around after the test suite is done.
System information (please complete the following information):
Additional information
Used to work fine with the old runner, so I switched back to that,
hoping nrunner gets fixed before the old runner is removed.
Which worked for a number of other nrunner issues, but not this one ...
test cases repo: https://gitlab.com/kraxel/edk2-tests
The text was updated successfully, but these errors were encountered: