Conversation
The test asserts that `start` succeeds on a container created without a `process`, while the requirement it reports under is the opposite one: runtime.md says the operation MUST generate an error if `process` was not set, and the command line interface requires a non-zero exit code on errors. A runtime that refuses the start is marked as failing, and one that quietly returns success passes. Expect the error. The container is then left in whichever state the runtime chose, and neither document says how to dispose of a container that has no `process` to signal, so clean up without asserting on the way out. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The container runs `true`, so it has already exited by the time the test tears it down. The teardown waits for it to be `running`, ignores the timeout it gets instead, kills it anyway and then reports the kill error as the result of the pid file check. Signalling a container that is neither `created` nor `running` MUST generate an error, so every runtime that gets that right fails a test about `--pid-file`. This is also the assertion kill.t case four makes, and no runtime could satisfy both. Wait for the process to exit on its own instead, which is all the teardown needs. Fixes opencontainers#805 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two validation tests assert the opposite of what the runtime-spec requires, and between them they make one requirement untestable and another impossible to satisfy.
validation/startasserts thatstartreturns no error for a container created without aprocess, while reporting the result underStartWithProcUnsetGenError, whichspecerrorregisters as a MUST against runtime.md#start: "This operation MUST generate an error ifprocesswas not set". Combined with the command line interface requirement thatstartexits "non-zero on errors", a compliant runtime must fail here, and the test marks it as broken for doing so while passing a runtime that silently returns success. The assertion is inverted to expect the error.Please note what that means in practice, because it is not comfortable: crun 1.29.1 fails the corrected assertion.
crun starton a container with noprocessprints "blockprocessnot found" and then exits 0, so on current masterstart.treports 7 ok and with this change it reports 6 ok and 1 not ok. I believe that is the test finding a real defect rather than a regression, given the two sentences quoted above, but it is the maintainers' call and I would rather raise it here than have it turn up after a merge.validation/pidfilefails against any runtime that getskillright. Its teardown waits for the container to berunning, which never happens because the container process istrueand has already exited, discards the resulting timeout, kills the stopped container anyway and then returns that kill error as the outcome of the--pid-filecheck. runtime.md#kill says signalling a container that is neithercreatednorrunningMUST generate an error, andvalidation/killcase four asserts precisely that and passes, so the two tests cannot both be satisfied.kill.tis the one with the spec behind it and is left alone; the pid file teardown now waits for the process to exit on its own, which is all it ever needed.Fixes #805
One loose end that belongs in runtime-spec rather than here. With the
startassertion corrected, the container is left in whichever state the runtime chose, and the spec has no defined route out: a failed operation "MUST leave the state of the environment as if the operation were never attempted" so it stayscreated,deleteMUST reject a container that is notstopped, andkillis defined in terms of a container process that aprocess-less container does not have. The test therefore tears down on a best-effort basis and asserts nothing about how. I intend to raise that gap against runtime-spec separately.