LukeMathWalker / wiremock-rs

HTTP mocking to test Rust applications.
Apache License 2.0
648 stars 73 forks source link

Simulate fault #149

Open Sytten opened 1 month ago

Sytten commented 1 month ago

It would be very useful to be able simulate faults to test how the program reacts to them.

LukeMathWalker commented 1 month ago

What kind of faults?

Sytten commented 1 month ago

Sorry for the lack of details. I meant to come back and fill the details.

The base and most useful case is simulating a network failure/disconnect (usually an EOF) mid transmission. That happens often to regular users so it interesting to test. This can also be used to simulate an offline mode.

It would also be nice to be able to control the frames that sent (like in chunked encoding) to introduce delays between chunks and also failures after a number of chunks.

See the Java implementation: https://wiremock.org/docs/simulating-faults/#bad-responses