Skip to content

CLI: Add virtiofs mapshared regression test - #41427

Merged
David Bennett (dkbennett) merged 5 commits into
masterfrom
user/dkbennett/viriofs_map_shared_test
Aug 25, 2026
Merged

David Bennett (dkbennett) merged 5 commits into
masterfrom
user/dkbennett/viriofs_map_shared_test

Conversation

@dkbennett

Copy link
Copy Markdown
Member

Summary

Add an E2E regression test for MAP_SHARED on Windows-backed WSLC bind mounts. This confirms behavior enabled by a virtiofs fix. This is a test-only PR that adds a single test.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

  • Targeted E2E test passed.
Copilot AI lite review requested due to automatic review settings August 24, 2026 21:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new WSLC E2E regression test intended to validate MAP_SHARED mmap behavior on Windows-backed bind mounts inside containers (and to ensure the mount is backed by virtiofs).

Changes:

  • Add a new container run E2E test that mounts a host directory into /data and runs a Python snippet that checks /data is a virtiofs mount.
  • Attempt an mmap(..., MAP_SHARED, ...) on a file inside the bind mount and validate the command exits successfully.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/windows/wslc/e2e/WSLCE2EContainerRunTests.cpp Outdated
Comment thread test/windows/wslc/e2e/WSLCE2EContainerRunTests.cpp
Copilot AI review requested due to automatic review settings August 24, 2026 21:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

OneBlue
Blue (OneBlue) previously approved these changes Aug 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

test/windows/wslc/e2e/WSLCE2EContainerRunTests.cpp:1200

  • This MAP_SHARED persistence check also uses Python assert, which can be optimized away. Raising an explicit exception keeps the test effective regardless of optimization settings and produces a clearer failure mode.
    with mmap.mmap(fd, 32 * 1024, flags=mmap.MAP_SHARED, prot=mmap.PROT_READ | mmap.PROT_WRITE) as mapping:
        mapping[0:1] = b'W'
        mapping.flush()
        assert os.pread(fd, 1, 0) == b'W'
Comment thread test/windows/wslc/e2e/WSLCE2EContainerRunTests.cpp
Copilot AI review requested due to automatic review settings August 24, 2026 22:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

OneBlue
Blue (OneBlue) previously approved these changes Aug 25, 2026
Comment thread test/windows/wslc/e2e/WSLCE2EContainerRunTests.cpp Outdated
VERIFY_IS_TRUE(std::filesystem::exists(EnvTestFile1));
VERIFY_ARE_EQUAL(32ull * 1024, std::filesystem::file_size(EnvTestFile1));

std::ifstream mappedFile(EnvTestFile1, std::ios::binary);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This could be simplified to: VERIFY_IS_TRUE(ReadFileContent(EnvTestFile1)[0], L'W');

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@dkbennett
David Bennett (dkbennett) enabled auto-merge (squash) August 25, 2026 19:28
@dkbennett
David Bennett (dkbennett) merged commit c78930c into master Aug 25, 2026
12 checks passed
@dkbennett
David Bennett (dkbennett) deleted the user/dkbennett/viriofs_map_shared_test branch August 25, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants