nim-chronos icon indicating copy to clipboard operation
nim-chronos copied to clipboard

tests not exception-safe

Open arnetheduck opened this issue 4 years ago • 0 comments

the unit test suite is not written in an exception safe way - this is problematic because:

  • tests are often a good source of example code - if they provide a bad example, the unsafe code spreads
  • failures in a single test cause transport not to be closed and subsequent tests to fail ("address in use") / give false negatives

example: https://github.com/status-im/nim-chronos/blob/e3ced62d4ba06b7ff638f6784e782046b1fadc70/tests/teststream.nim#L74

arnetheduck avatar Feb 03 '20 11:02 arnetheduck