Skip to content
Snippets Groups Projects

arti-testing: support for simulated TCP breakage

Merged Nick Mathewson requested to merge nickm/arti:arti-testing-part2 into main
2 unresolved threads

This is the second part of my work on arti-testing, to help simulate failures for #329 (closed).

This branch makes it possible for TCP connections to fail with an IO error, time out, or succeed but ignore all data. These failures can be enabled immediately, after a delay, or in a particular stage. Failures can be set up for all TCP connections, IPv4 only, IPv6 only, or non-443.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
7 use anyhow::anyhow;
8 use async_trait::async_trait;
9 use futures::io::{AsyncRead, AsyncWrite};
10 use pin_project::pin_project;
11 use rand::{thread_rng, Rng};
12 use std::io::{Error as IoError, ErrorKind as IoErrorKind, Result as IoResult};
13 use std::net::SocketAddr;
14 use std::pin::Pin;
15 use std::str::FromStr;
16 use std::sync::{Arc, Mutex};
17 use std::task::{Context, Poll};
18 use std::time::Duration;
19
20 /// An action that we can take upon trying to make a TCP connection.
21 #[derive(Debug, Clone)]
22 pub(crate) enum Action {
  • eta approved this merge request

    approved this merge request

  • Contributor

    Nice! Feel free to merge (after maybe making that one struct Copy :p)

  • Okay, will do!

  • Nick Mathewson added 1 commit

    added 1 commit

    • d1b15143 - arti-testing: Make Action implement Copy

    Compare with previous version

  • Nick Mathewson enabled an automatic merge when the pipeline for d1b15143 succeeds

    enabled an automatic merge when the pipeline for d1b15143 succeeds

  • Nick Mathewson mentioned in commit 98c5c5b8

    mentioned in commit 98c5c5b8

  • Please register or sign in to reply
    Loading