Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It's a clean install of Drupal 7 CVS 30/07/2009.
Running the simpletest I have: one fail in Blog, and one crash error.
Fail in blog:
Users blog displayed with no entries Other blog.test 54 BlogTestCase->testBlogPageNoEntries()
Crash error:
An error occurred.
Path: /batch?id=2&op=do
Message: PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'field_name' at row 1: INSERT INTO {field_config} (field_name, type, locked, data, module, cardinality, active, deleted) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array
(
[:db_insert_placeholder_0] => drupal_s7262919eyte9wf_field_name
[:db_insert_placeholder_1] => test_field
[:db_insert_placeholder_2] => 0
[:db_insert_placeholder_3] => a:2:{s:8:"settings";a:1:{s:18:"test_field_setting";s:17:"dummy test string";}s:7:"indexes";a:1:{s:5:"value";a:1:{i:0;s:5:"value";}}}
[:db_insert_placeholder_4] => field_test
[:db_insert_placeholder_5] => 4
[:db_insert_placeholder_6] => 1
[:db_insert_placeholder_7] => 0
)
in drupal_write_record() (line 4547 of /persistent/home/int/sites/drupal7/includes/common.inc).
Comment | File | Size | Author |
---|---|---|---|
#63 | 535440_simpletest_random_d7.patch | 4.97 KB | andypost |
#59 | 535440_simpletest_random_d7.patch | 4.31 KB | andypost |
#57 | 535440_simpletest_random_d7.patch | 3.21 KB | andypost |
#41 | simpletest-random-strings-cleanup.2.patch | 4.03 KB | carlos8f |
#40 | simpletest-random-strings-cleanup.patch | 3.9 KB | carlos8f |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedPlease tell us more about your environment (types and versions of your webserver, PHP, and database engine).
Comment #2
int CreditAttribution: int commentedThe crash error is in field's.
MySQL: 5.1.30really5.0.75-0ubuntu10 (InnoDB)
PHP:5.2.6-3ubuntu4.1
webserver: Apache/2.2.11 (Ubuntu) PHP/5.2.6-3ubuntu4.1 with Suhosin-Patch
Comment #3
int CreditAttribution: int commentedNow nothing work's.
I "Clean (the) test environment" with the button, and I run anyone.. but none work's..
See:
I go back to the DB and I have this simpletest tables:
Don't exists this table: drupal_simpletest705302cache_update
Comment #4
int CreditAttribution: int commentedI desactivated the CVS Deploy module, and now I can run simpletest again.. (may one error or the cache was cleaned)
But the errors in the 1first post still happen.
Comment #5
int CreditAttribution: int commentedI continue to test the others tests without the field test, and give me more fails:
Enable/disable modules: 49 passes, 4 fails, and 0 exceptions
SimpleTest functionality: 67 passes, 17 fails, and 34 exceptions
Comment #6
Damien Tournoud CreditAttribution: Damien Tournoud commentedCannot reproduce. Is there something special in your configuration? I have never seen MySQL returning a "Data too long for column" error.
Comment #7
int CreditAttribution: int commentedI don't think so.
I have Ubuntu 9.04 (in Amazon EC2)
The error when I test the simpletest.test
Edited: maybe is because the Ubuntu PHP use by default "Suhosin-Patch"
Comment #8
int CreditAttribution: int commented@Damien Tournoud I know why I have this errors :)
The table {field_config}.field_name have 32 chars.. But the string that want to insert is 33 chars. ("drupal_s7262919eyte9wf_field_name")
So why this happen only with me? because I have the drupal_prefix: drupal_
So we have to recheck all tables, or change the string. And put the simpletest to allways test with one random drupal prefix.
Comment #9
int CreditAttribution: int commentedChange the title.
I don't know if with the table prefix will we also find others errors.
Comment #10
int CreditAttribution: int commentedComment #11
boombatower CreditAttribution: boombatower commentedThere is not need to append strings to randomly generated strings (unless test uses the suffix _field_name instead of looking for the whole thing). This should obviously still generate really long strings is db prefix is longer. Perhaps we should generate only include the SimpleTest part of the prefix since it is only being added to ensure uniqueness.
Comment #12
int CreditAttribution: int commented@boombatower are you sure that this patch resolve all drupal prefix problems?
you are only changing the field.test and this issue is about all simplestest.
I think that you are only remove 11 fixed chars, but the table prefix can have more (and is dynamic), so you are fix nothing..
With this patch resolve the field error with drupal_ prefix, if I have www_site_example_org_ maybe will give that error again.
Comment #13
boombatower CreditAttribution: boombatower commentedRight, which is what I commented on. Better patch.
Comment #14
boombatower CreditAttribution: boombatower commentedComment #16
int CreditAttribution: int commentedThis patch only work for this two modules:
blog.test Now work
field.test Now work
But don't fix all errors and introduce others.
And I think that we may want to change testing.drupal.org to test also with one table prefix.
Comment #17
boombatower CreditAttribution: boombatower commentedTook me a bit to track down upload error.
Comment #18
boombatower CreditAttribution: boombatower commentedI am going to install Drupal in prefix of drupal_ as you have see what I get, I can't see why this would introduce more errors that testbot doesn't see.
Comment #19
int CreditAttribution: int commented@boombatower with patch #17 I don't have errors, but I'm still testing
Comment #20
boombatower CreditAttribution: boombatower commentedI am going to install Drupal in prefix of drupal_ as you have see what I get, I can't see why this would introduce more errors that testbot doesn't see.
Comment #21
boombatower CreditAttribution: boombatower commentedDoesn't seem to create any problems (obviously didn't run all tests).
Comment #22
int CreditAttribution: int commentedComment #23
boombatower CreditAttribution: boombatower commentedI get the feeling that is unrelated to this patch and probably always occured for you.
Comment #24
int CreditAttribution: int commented@boombatower, yes for sure.. I allready have this error in the #7 post.
But this error probably is also about table prefix..
I have errors in is two test:
Enable/disable modules
Simpletest
Comment #25
boombatower CreditAttribution: boombatower commentedI am not sure how much further to take this, or if it makes sense to. Removing the host prefix from the randomName() method makes sense, but to do so from all table names is not a good idea. It would seem that is the issue you are having. We may just be running into the limits that database set. As such, either the tests themselves can be tweaked...or SimpleTest just won't work on a prefixed host for all test.
Comment #26
boombatower CreditAttribution: boombatower commentedApplied the removal of host prefix to randomString() as well.
Comment #27
int CreditAttribution: int commentedStill apply to HEAD, and work.
Comment #28
mgiffordI just applied this patch:
patch -p0 < 535440-shorten-random_1.patch
Got this nasty error:
Which is worse than the previous nasty error I got:
and continuing on to the "Please continue to the error page" error page link now just gives me:
Error message No active batch.
I'm very frustrated with simpleTests right now. It's a system with a lot of potential, but...
Comment #29
int CreditAttribution: int commentedYes, you are correct.
The patch still apply to the HEAD but now don't fix the error.. Something change since 1 August.
Comment #30
cburschka#667416: Filefield tests fail with db_prefix > 6 characters is a duplicate of this problem.
Comment #34
int CreditAttribution: int commentedComment #35
c960657 CreditAttribution: c960657 commentedWhy is the $db_prefix added to the random strings in the first place? This was introduced in #295864: SimpleTest: Change randomName() method to randomString() but without any real explanation AFAICT. Previously randomName() had a prefix argument that allowed each caller to get their own prefix, but prefixing all strings in a test with the same prefix seems doesn't seem to have a good purpose, does it?
Comment #36
cburschkaNo, it doesn't. All it does is cause two problems in several places:
a.) The strings are way too big for database tables, and other things (drupal_simpletest19344_field_something_something_drupal_simpletest19344, wtf?)
b.) The strings are longer than the length that the caller asks for. This has actually resulted in a test passing when it should have failed, on a 255 character boundary issue.
Can we please make these prefixes just disappear entirely from the random functions?
Comment #37
c960657 CreditAttribution: c960657 commentedThis patch strips the prefix from the random strings.
Comment #39
c960657 CreditAttribution: c960657 commentedNow that randomName() does not add a prefix, we need to make sure that field names do not start with a digit.
Comment #40
carlos8f CreditAttribution: carlos8f commentedEasier to just have randomName() start the string with a letter.
Comment #41
carlos8f CreditAttribution: carlos8f commentedglobal $db_prefix
is not needed in those functions, either.Comment #43
carlos8f CreditAttribution: carlos8f commentedHmm, there is no functional difference between #40 and $41, so why the failures? Perhaps it is because the strings are actually random now, rather than having a predictable prefix.
Comment #45
int CreditAttribution: int commentedyou can allways re-tested.. but if this time it pass.. and the problems isn't from the bot itseft.. we should remove the randomtest and create 3 or more static tests..
Comment #46
carlos8f CreditAttribution: carlos8f commentedYes, there is a peculiar problem now because the tests fail only some of the time when randomName() and randomString() return truly random strings. This would take a lot of trial and error to work out due to the chancy nature of the failures. I would assume the failing tests have design flaws, since randomName() etc should actually return a random string, not a $db_prefix + random string.
Comment #48
boombatower CreditAttribution: boombatower commented/me likes
Comment #49
carlos8f CreditAttribution: carlos8f commentedHold it! This patch has been documented to make some tests fail non-reliably, and #41 was re-tested before I could document what the fails were. It indicates that some tests in our suite are written under false assumptions that randomName() and randomString() have 1) a certain minimum length and 2) a predictable prefix. Since we are removing that, we need to run tests over and over to determine which ones need tweaking.
Comment #50
boombatower CreditAttribution: boombatower commentedSounds fun.
Perhaps just make a couple of patches the generate strings with small count (min), max, etc. I'm sure you can figure it out ;)
Comment #52
carlos8f CreditAttribution: carlos8f commentedThis isn't a show-stopper, since it only affects tests and tests are done in a controlled environment anyway. Still would be nice to work out though.
Comment #54
andypost@carlos8f What for you change dblog.test ? checkplain for limited set of ascii chars? and limit to 4?
Comment #55
c960657 CreditAttribution: c960657 commentedThe changes to DBLog are actually just a workaround for #718662: DBLog listings truncate messages in the middle of HTML tags (I did not realize this entirely when I wrote the patch in comment #37).
It's a bit tricky: When the username is 8 characters long (with the patch in this issue, randomName() by default returns 8 characters instead of a much longer string), the test looks for
Session opened for <em class="placeholder">rtBXvJNp</em>
(56 characters). However, the real string in user.module isSession opened for <em class="placeholder">rtBXvJNp</em>.
(57 characters - note the trailing period), and that is truncated toSession opened for <em ...
, i.e. the test now fails. Without the patch, randomName() returned a longer string that were truncated in both cases.We should probably wait for that bug to land before proceeding in this issue.
Comment #56
andypostSo waiting for someone to re-roll patch and there's enough people to RTBC :)
Comment #57
andypostHere is re-roll except hunk from #718662: DBLog listings truncate messages in the middle of HTML tags
Comment #59
andypostRe-roll with fix for search tests - use explicit "search string" else string could be partially displayed so test will fall randomly...
Still depends on #718662: DBLog listings truncate messages in the middle of HTML tags
Comment #61
andypost#59: 535440_simpletest_random_d7.patch queued for re-testing.
Comment #63
andypostSearch comment tests changed to use exactly "Test comment subject" and "Test comment body" because using random{Name|String} could produce names that less then 3 chars so brings random test fails.
Also limited username in dblog tests, suppose this change has more priority then #718662: DBLog listings truncate messages in the middle of HTML tags
Comment #64
andypostNow patch stably performs tests!
Comment #65
boombatower CreditAttribution: boombatower commentedComment #66
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.