Skip to content

How to test I/O errors #575

Open
Open
@brson

Description

@brson

I just posted a fix for a file system error that I can't test for. rustup error handling is important but hard to test. In this case I would want to trigger out-of-disk during an installation. I'd prefer to be able to test this stuff.

I see two options:

  • Write a fuse filesystem to create the errors. Requires a lot of work, only works for file system access, not network.
  • Add mocking to the rustup-utils I/O functions, so that the test runner can e.g. set environment variables telling the I/O layer to generate specific errors. Downside is that it's ugly and isn't exercising big parts of the I/O stack.

I'm inclined toward the latter. @alexcrichton do you have opinions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions