How can I avoid running some tests in parallel?

后端 未结 3 776
灰色年华
灰色年华 2021-01-14 17:49

I have a collection of tests. There are a few tests that need to access a shared resource (external library/API/hardware device). If any of these tests run in parallel, they

3条回答
  •  离开以前
    2021-01-14 18:29

    Use the serial_test crate. With this crate added, you put in your code:

    #[serial]
    

    in front of any test you want run in sequentially.

提交回复
热议问题