matlab.unittest.TestCase automatic retry
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Christopher Hummersone
el 8 de Ag. de 2022
Comentada: Christopher Hummersone
el 8 de Ag. de 2022
We have a test suite that relies on an external process. That process seems to be ... flaky. Since the process is a local webserver, my idea is to catch exceptions thrown when the HTTP request from Matlab times out, using a listener on the matlab.unittest.TestCase:
testCase.addlistener('ExceptionThrown', @(src, evnt) ..)
then relaunch the flaky process, and rerun the test case.
I've written a class derived from TestRunnerPlugin to manage most of this, but I cannot figure out how to re-run the test case. Any ideas?
0 comentarios
Respuestas (1)
Steven Lord
el 8 de Ag. de 2022
This isn't directly an answer to your question, but as an alternative to always needing to rerun some or all of your tests can you mock the web server for most of your tests? The mock ought to be more stable than the real web server.
Ver también
Categorías
Más información sobre Testing Frameworks en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!