tests/int/checkpoint: fds and pids cleanup#2509
Conversation
1. Do not use hardcoded fd numbers, instead relying on bash feature of
assigning an fd to a variable.
This looks very weird, but the rule of thumb here is:
- if this is in exec, use {var} (i.e. no $);
- otherwise, use as normal ($var or ${var}).
2. Add killing the background processes and closing the fds to teardown.
This is helpful in case of a test failure, in order to not affect the
subsequent tests.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
|
@tianon @adrianreber @avagin PTAL |
adrianreber
left a comment
There was a problem hiding this comment.
It looks weird, indeed. If it works, good. Looks more flexible than hardcoding.
This should not longer be necessary (in theory, at least), let's see how it goes. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
|
The |
|
I've also |
|
@AkihiroSuda @mrunalp PTAL (this should make our CI cleaner a bit) |
Clarification on "somehow". The removal of "read-only" was preventing the following like from appearing in the logs:
The thing is, this was not an error but actually warning, since the code was working around the read-only state, so clearing the read-only state was not needed. Later, checkpoint-restore/criu#1033 demoted that error to a warning, so since criu 3.14 it is no longer appearing as an error. But even without this patch read-only could safely be removed. |
Do not use hardcoded fd numbers, instead relying on bash feature of
assigning an fd to a variable.
This looks very weird, but the rule of thumb here is:
exec, use{var}(i.e. no$);$varor${var}).Add killing the background processes and closing the fds to teardown.
This is helpful in case of a test failure, in order to not affect the
subsequent tests. Found in libct/cgroups/GetCgroupRoot: make it faster #2507 (comment)
Drop removing readonly flag for lazy cpt tests, it is no longer required
(see get_clean_mount: demote an error to a warning checkpoint-restore/criu#1033, runc lazy-pages test case needs "readonly": false (Error (criu/mount.c:1119): mnt: Can't create a temporary directory: Read-only file system) checkpoint-restore/criu#575)