Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
simpletest.module
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
6 Aug 2008 at 05:29 UTC
Updated:
29 Aug 2008 at 07:54 UTC
Jump to comment: Most recent file
The simpletest and simpletest_test_id are never cleared and just grow exponentially. This patch clears them after displaying the results and adds them to the clean environment function.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | simpletest_remove_test_results.patch | 1.87 KB | boombatower |
| #10 | simpletest_remove_test_results.patch | 1.73 KB | boombatower |
| #7 | simpletest_remove_test_results.patch | 1.77 KB | boombatower |
| simpletest_remove_test_results.patch | 1.57 KB | boombatower |
Comments
Comment #1
boombatower commentedDoesn't break tests as I just ran them all.
Comment #2
damien tournoud commentedWell it doesn't grow exponentially, just linearly.
Also, could you please move the DELETE query *after* the result set from the previous SELECT query has been used. This is probably valid (PHP caches the whole result set), but it makes me itch.
Comment #3
boombatower commentedAre you asking to have these lines removed? If so that is part of the purpose of this patch. To delete the results after they are displayed.
exponentially is figure of speech (at least how I use it)< /note>
Comment #4
damien tournoud commentedNo, I just ask that they are moved *after* the result set from the SELECT query is fully used, ie. after all the
db_fetch_object()calls.Comment #5
cwgordon7 commentedI think this patch is very scary. What if one user starts running all tests, and in the middle, another user decides to clean the environment?
I see no real advantages to deleting from the database, and I see possible loss of data (which is a big concern for those of us who take over an hour to run all tests).
Comment #6
boombatower commentedIf someone cleans environment the tests may get fried anyway as it will kill the current sessions database. That is an edge case that is not supported. The only case when multiple instances of tests should be running is on testing servers as part of t.d.o. The clean environment is used for developers when tests may crash and is used to clean up the mess. In normal operations of simpletest they should never fail.
I will move the deletes to after (on mobile, not dev box).
Comment #7
boombatower commentedUntested, but essential the same.
Comment #8
boombatower commentedMoved version seems to work great.
Comment #9
wim leersCoding style issue:
And a big consistency issue:
There are THREE different ways to describe the same action:
- "clear" in the doxygen
- "clean" in the function name
- "remove" in the code comments and the dsm call.
Leaving at CNR because it's just coding style issues.
Comment #10
boombatower commentedI assume the issue is
should be on one line. I just fine
allot cleaner, but I forget that isn't standard.
Change "Remove" to "Clear" in comments, but clean is to be consistent with clean_evironment which is overarching operation.
Comment #11
wim leersI agree that
is much more readable, and I do this myself as well, but for such a simple query the benefit is lost completely :)
Comment #12
chx commentedDoing it separately is fine. I did not want to delete once test is over but this is ok.
Comment #13
boombatower commentedAfter discussion with chx we decided to add a conditional check on variable
simpletest_clear_resultswhich isn't displayed UI anywhere, but would be useful down the road if contributed modules wanted to provide analysis on the results.Comment #14
damien tournoud commentedLooks good to me. Where should we document the variable?
Comment #15
boombatower commentedTested seems to work great. Anyone want to try it out?
Comment #16
boombatower commentedping.
Comment #17
dries commentedPatch no longer applies and needs a re-roll.
A code review reveals no issues. Should land after a quick re-roll.
Comment #18
boombatower commentedIt would appear that this has already been committed... hmm??.
Comment #19
dries commentedYes, I think I accidentally committed it. Let's mark it fixed.
Comment #20
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.