Skip to content

[Refactor]: Extract Checkpoint/Restore terminal spawn logic into test_utils.rs #3529

@tommady

Description

@tommady

Background

In the Checkpoint/Restore test suite (tests/contest/contest/src/tests/checkpoint_restore/mod.rs), we heavily rely on the OCI terminal: true requirement to test persistent IPC file descriptors (FIFOs).

Because terminal: true requires an active console socket, the C/R tests use a specialized CrTestContext::start method.

This method concurrently spawns the container in detached mode (run -d --console-socket), accepts the socket connection, and hands it off to handle_console_socket(stream).

Currently, this -d spawn and concurrent socket-handling logic is encapsulated exclusively within the C/R test context.

Feature Request

During the review of PR #3493, see link to PR comment, it was pointed out that this logic could be highly useful for other test suites that might need to test console sockets or detached runs in the future.

We agreed to extract this out of CrTestContext and into tests/contest/contest/src/utils/test_utils.rs as a global helper, but deferred it to this separate PR to avoid delaying the core C/R features and to properly review the global test utility changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions