Make tokio::test
attribute compatible with sealed_test
attribute
#7045
Labels
tokio::test
attribute compatible with sealed_test
attribute
#7045
Is your feature request related to a problem? Please describe.
I use
sealed_test
crate for marking tests withsealed_test
attribute to isolate environments. This does not function when combined withtokio::test
attribute, which is desired for tests that need an isolated environment plus tokio time manipulation.Looking at generated code for a test marked with both
tokio::test
andsealed_test
, it appears thattokio::test
adds the#[::core::prelude::v1::test]
attribute whilesealed_test
adds the#[test]
attribute; those two attributes combined make the test run twice, which fails since the environment is supposed to be isolated and this affects socket binds due to "Address in use" error.Describe the solution you'd like
tokio::test
attribute is able to be used in combination withsealed_test
crate's attribute.Describe alternatives you've considered
No real solution I can think of; to work around, I create a tokio runtime manually and spawn/block-on async code when using
sealed_test
.Additional context
N/A
The text was updated successfully, but these errors were encountered: