Skip to content

[1.5] libct/int: better error reporting - #5246

Merged
lifubang merged 5 commits into
opencontainers:release-1.5from
kolyshkin:1.5-5232
Apr 16, 2026
Merged

lifubang merged 5 commits into
opencontainers:release-1.5from
kolyshkin:1.5-5232

Conversation

@kolyshkin

Copy link
Copy Markdown
Contributor

Backport of #5232.


Saw the following failure (from here):

=== RUN   TestHook
time="2026-04-08T18:10:08Z" level=warning msg="cannot serialize hook of type configs.FuncHook, skipping"
....
time="2026-04-08T18:10:08Z" level=warning msg="cannot serialize hook of type configs.FuncHook, skipping"
    exec_test.go:1090: unexpected error: exit status 1
--- FAIL: TestHook (0.09s)

It looks like we're running commands and expect them to exit(0), but when they fail we have no way of knowing what went wrong.

Address this by showing process' stderr if something bad happens.

While at it,

  • remove buffers.Stdin (unused);
  • replace bytes.Buffer with strings.Builder.

Related to #5245

Since Wait returns an ExitError if process' exit status is not 0,
checking process status is redundant and this code is never reached.

Remove it.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit dd9fda7)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
When running a process inside a container, make sure its stderr is not
nil (except for some trivial cases like cat). Modify waitProcess to show
failed command's stderr, if possible.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit bf4fcc3)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
By default, readlink is silent about any errors. Make it verbose so we
can better interpret any test failures.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 54be90b)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
It is never used.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 568a309)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
The latter is simpler and provides just enough functionality to be used
here.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 9970cbf)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin kolyshkin added this to the 1.5.0 milestone Apr 15, 2026
@kolyshkin kolyshkin added area/ci backport/1.5-pr A backport PR to release-1.5 labels Apr 15, 2026
@lifubang
lifubang merged commit c0b996d into opencontainers:release-1.5 Apr 16, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci backport/1.5-pr A backport PR to release-1.5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants