-
Notifications
You must be signed in to change notification settings - Fork 54
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
"corruption" of .testmondata by an external exception (eg. Database connection or wrong environment) #66
Comments
The basic idea is that mtimes and file_checksums are just helper/optimization data for large projects. They must not be written after every executed test, because:
The dependencies itself, however, should be written after every test, because some test suites take hours and we shouldn't loose all the data on interruption. So far I'm committed to fulfill this requirement. In other words, current implementation is careful tradeoff between complexity of implementation and performance. And it's unlikely I would like to change it before refactoring the data model (which would fix this, by itself) and refactoring the test suite. Could you rephrase your requirement in other terms? How do you experience the disadvantage now? Do you have a huge test file which you frequently run with -x and do you have slow start-up? Is there a printout which bothers you? |
@tarpas The simple test case is:
This is bad already, but when you explicitly change a file where tests were recorded as failing, testmon will not pick it up: it seems to only look at mtimes for this, which is empty. What do you think about #67 in this regard? |
Seems like a serious bug. The bug is only when you interrupt the first run (with no .testmondata)? |
At least that is how I'm able to easily reproduce it (and #67 fixes that). Also using It might be related to b59154b after all. |
Daniel, after thinking about it I must say this is by design. When you read the text on http://testmon.org -> Thoughts -> "5. External services (reached by network)" you have to realize database is just that. A test which ends early with database error is captured in .testmondata as depending only on the first couple of lines. After starting the database and re-running the test, testmon doesn't register any change, so it only re-reports the old exception and doesn't attempt to run the test again. We could implement a switch/command which re-executes all failures regardless of the .testmondata. That would also mitigate #57 . What UI do you recommend? py.test --testmon --tlf |
|
@blueyed I would consider this fixed for now. Maybe there could be heuristics which wouldn't write the data if too many tests fail too quickly. Maybe there could be an option for rollback of the last run, or some other UI which would let you choose if to write or discard the .testmondata changes. |
Test node data gets saved after the test finishes (via
set_dependencies
inpytest-testmon/testmon/testmon_core.py
Line 112 in 8b9c034
-x
triggers it),TestmonData.write_data
is not skipped, which will not save the correspondingmtimes
andfile_checksums
metadata.(via #60 (comment))
I think
set_dependencies
should really only set them, but then be skipped also when not writingmtimes
, or the mtimes should be updated together with the dependencies.The text was updated successfully, but these errors were encountered: