1

When using ert I'd sometimes like to have tests abort after some timeout. I could program this in advance in the test-case but this is not what I need.

Imagine a situation where I use ert-run-tests-batch for non-regression testing after I modified something in the code. The new code may introduce a bug where, say, some test case will loop forever. This blocks the rest of the test batch and, to make matter worse, it is not easy to find out which test exactly tripped the infinite loop.

To avoid this, I'd like to be able to say something like run all selected tests but abort any that lasts more than 1 second, knowing that they usually pass very quickly. I looked in the ert manual but could not find anything relevant. Is there a hidden way that someone knows of?

phs
  • 1,095
  • 6
  • 13
  • Not ert related, but are you able to use `with-timeout`? – C4ffeine Add1ct Aug 10 '21 at 10:00
  • `with-timeout` probably won't work if the loop doesn't look for some external input somewhere. This seems like a case where you need to run the tests asynchrously, then after a certain amount of time check the results. I guess you could kill any process that takes too long. – John Kitchin Aug 10 '21 at 13:33

0 Answers0