New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests that fail before the scheduler are not handled properly #1253
Comments
Note, this isn't an issue if the test coroutine is an async function. When async functions are called, nothing executes immediately, so they cannot fail until they get to the scheduler. |
Pretty sure we could detect this with |
I just didn't find a clean way of modifying |
PR appreciated, this has been annoying me for a while when writing and screwing up new tests. |
I'm actually wondering if instead of modifying the regression manager I should modify the decorators so that If that's the case, this will wait until #1255 or #1259 are merged. EDIT: I didn't quite understand what was going on, but now I do. Cocotb coroutines are not immediately started just like async coroutines. The issue is with errors that cause coroutine initialization to fail like |
Fixes cocotb#1253. Code is cleaned up slightly. More PEP8 changes. More comments.
Fixes cocotb#1253. Code is cleaned up slightly. More PEP8 changes. More comments.
Fixes cocotb#1253. Code is cleaned up slightly. More PEP8 changes. More comments.
I suspect the issue is actually errors during coroutine initialization, such as:
or
|
Fixes cocotb#1253. Code is cleaned up slightly. More PEP8 changes. More comments.
Fixes cocotb#1253. Code is cleaned up slightly. More PEP8 changes. More comments.
Fixes cocotb#1253. Code is cleaned up slightly. More PEP8 changes. More comments.
Fixes cocotb#1253. Code is cleaned up slightly. More PEP8 changes. More comments.
Fixes cocotb#1253. Code is cleaned up slightly. More PEP8 changes. More comments.
Fixes cocotb#1253. Code is cleaned up slightly. More PEP8 changes. More comments.
Fixes cocotb#1253. Code is cleaned up slightly. More PEP8 changes. More comments.
Fixes cocotb#1253. Code is cleaned up slightly. More PEP8 changes. More comments.
Fixes cocotb#1253. Code is cleaned up slightly. More PEP8 changes. More comments.
Fixes cocotb#1253. Code is cleaned up slightly. More PEP8 changes. More comments.
Fixes cocotb#1253. Code is cleaned up slightly. More PEP8 changes. More comments.
Fixes cocotb#1253. Code is cleaned up slightly. More PEP8 changes. More comments.
Fixes cocotb#1253. Code is cleaned up slightly. More PEP8 changes. More comments.
Fixes cocotb#1253. Code is cleaned up slightly. More PEP8 changes. More comments.
Fixes cocotb#1253. Code is cleaned up slightly. More PEP8 changes. More comments.
Fixes cocotb#1253. Code is cleaned up slightly. More PEP8 changes. More comments.
There are two places in the RM that initialize coroutines, each had slightly different code, so this was factored out into a method init_test. init_test can fail, and so can a test at any point in it's run (previously handled by handle_result), so scoring a test as a pass or a fail depending upon the result and expected behavior is factored out into a method score_test. Now results are handled during initialization, which fixes cocotb#1253.
There are two places in the RM that initialize coroutines, each had slightly different code, so this was factored out into a method init_test. init_test can fail, and so can a test at any point in it's run (previously handled by handle_result), so scoring a test as a pass or a fail depending upon the result and expected behavior is factored out into a method score_test. Now results are handled during initialization, which fixes #1253.
For example:
cocotb/tests/test_cases/test_cocotb/test_cocotb.py
Lines 85 to 88 in 92a032a
This is considered "N/A" in the regression results banner and passes whether
expect_fail
orexpect_error
are set toTrue
orFalse
. A traceback is printed, but it's not apparent there was any failure if you are running a number of tests, like intest_cocotb
.The regression manager nor the
cocotb.test
decorator make any attempt to handle potential issues.cocotb/cocotb/regression.py
Line 157 in 92a032a
cocotb/cocotb/decorators.py
Lines 477 to 478 in 92a032a
I put some time into refactoring
initialize
andhandle_result
in the regression manager, but felt like I more or less had to copy-paste to victory, which I didn't like. I think a larger refactor is in order.The text was updated successfully, but these errors were encountered: