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.
This issue is similar to https://www.drupal.org/node/1884182
and it affects the core testing.
The connection is here
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Database!Driver!s...
But because the default limit is 999, the tests fail to get written in results/ with the error bellow:
Drupal test run
---------------
All tests will run.
Test run started:
Tuesday, September 23, 2014 - 11:18
Test summary
------------
[32mDrupal\system\Tests\Action\ActionUnitTest 15 passes
[0m [32mDrupal\action\Tests\ConfigurationTest 51 passes
[0m [32mDrupal\action\Tests\ActionUninstallTest 13 passes
[0m [32mDrupal\action\Tests\BulkFormTest 52 passes
[0m [32mDrupal\aggregator\Tests\AggregatorConfigurationTest 43 passes
[0m [32mDrupal\aggregator\Tests\AggregatorCronTest 55 passes
[0m [32mDrupal\aggregator\Tests\DeleteFeedTest 34 passes
[0m [32mDrupal\aggregator\Tests\AddFeedTest 67 passes
[0m [32mDrupal\aggregator\Tests\DeleteFeedItemTest 270 passes
[0m [32mDrupal\aggregator\Tests\FeedCacheTagsTest 227 passes
[0m [32mDrupal\aggregator\Tests\FeedFetcherPluginTest 63 passes
[0m [32mDrupal\aggregator\Tests\FeedLanguageTest 57 passes
[0m [32mDrupal\filter\Tests\FilterFormatAccessTest 292 passes
[0m [32mDrupal\aggregator\Tests\Views\IntegrationTest 38 passes
[0m [32mDrupal\system\Tests\Ajax\CommandsTest 77 passes
[0m [32mDrupal\aggregator\Tests\AggregatorRenderingTest 236 passes
[0m [32mDrupal\aggregator\Tests\ImportOpmlTest 66 passes
[0m [32mDrupal\aggregator\Tests\UpdateFeedTest 76 passes
[0m [32mDrupal\aggregator\Tests\ItemCacheTagsTest 176 passes
[0m [32mDrupal\system\Tests\Ajax\ElementValidationTest 13 passes
(... reduced output)
[0m [32mDrupal\views_ui\Tests\HandlerTest 311 passes
[0m [32mDrupal\views_ui\Tests\StyleTableTest 17 passes
[0m [32mDrupal\views_ui\Tests\PreviewTest 135 passes
[0m [32mDrupal\views_ui\Tests\StyleUITest 39 passes
[0m [32mDrupal\views_ui\Tests\ViewsUITourTest 23 passes
[0m [32mDrupal\views_ui\Tests\OverrideDisplaysTest 150 passes
[0m [32mDrupal\views_ui\Tests\WizardTest 26 passes
[0m [32mDrupal\views_ui\Tests\DisplayTest 214 passes
[0m [32mDrupal\views_ui\Tests\ViewEditTest 159 passes
[0m
Test run duration: 39 min 37 sec
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1 too many SQL variables' in /var/www/core/lib/Drupal/Core/Database/Connection.php:336
Stack trace:
#0 /var/www/core/lib/Drupal/Core/Database/Connection.php(336): PDO->prepare('SELECT * FROM s...')
#1 /var/www/core/lib/Drupal/Core/Database/Connection.php(536): Drupal\Core\Database\Connection->prepareQuery('SELECT * FROM {...')
#2 /var/www/core/scripts/run-tests.sh(913): Drupal\Core\Database\Connection->query('SELECT * FROM {...', Array)
#3 /var/www/core/scripts/run-tests.sh(92): simpletest_script_reporter_write_xml_results()
#4 {main}
Next exception 'Drupal\Core\Database\DatabaseExceptionWrapper' with message 'SQLSTATE[HY000]: General error: 1 too many SQL variables: SELECT * FROM {simpletest} WHERE test_id IN (:test_ids_0, :test_ids_1, :test_ids_2, :test_ids_3, :test_ids_4, :test_ids_5, :test_ids_6, :test_ids_7, :test_ids_8, :test_ids_9, :test_ids_10, :test_ids_11, :test_ids_12, :test_ids_13, :test_ids_14, :test_ids_15, :test_id in /var/www/core/lib/Drupal/Core/Database/Connection.php on line 569
Actual testbot command:
/usr/bin/php ./core/scripts/run-tests.sh --concurrency 8 --php /usr/bin/php --url http://ec2-54-198-133-147.compute-1.amazonaws.com/checkout --keep-results --all --clean
New testbot command:
php ./core/scripts/run-tests.sh --php /usr/bin/php --url 'http://localhost' --color --concurrency 6 --verbose --xml '/var/workspace/results' --sqlite /var/www/test.sqlite --dburl pgsql://drupaltestbot:drupaltestbotpw@172.17.1.83/build_2014_09_12_190001 --keep-results --all
Comment | File | Size | Author |
---|---|---|---|
#25 | drupal-test-script-2343389-25.patch | 2.96 KB | Sutharsan |
#25 | interdiff-2343389-24-25.txt | 1.64 KB | Sutharsan |
#24 | drupal-test-script-2343389-24.patch | 3.18 KB | Sutharsan |
#17 | drupal-test-script-2343389-17.patch | 2.94 KB | Sutharsan |
#15 | drupal-test-script-2343389-15.patch | 2.18 KB | Sutharsan |
Comments
Comment #1
ricardoamaro CreditAttribution: ricardoamaro commented@sun, @jthorson, ping
Comment #2
ricardoamaro CreditAttribution: ricardoamaro commentedComment #3
ricardoamaro CreditAttribution: ricardoamaro commented@Sutharsan, thanks for having a look
Therefore, to fix this we need to fix the "--sqlite" option to divide the query in parts.
Comment #4
Sutharsan CreditAttribution: Sutharsan commentedThis should fix the problem. If required, it performs multiple select queries to load the test results.
Comment #5
ricardoamaro CreditAttribution: ricardoamaro commentedWoot!
Comment #6
ricardoamaro CreditAttribution: ricardoamaro commentedRunning:
Comment #7
ricardoamaro CreditAttribution: ricardoamaro commentedRunning...
Comment #8
ricardoamaro CreditAttribution: ricardoamaro commentedStill go the same error... :(
Comment #9
ricardoamaro CreditAttribution: ricardoamaro commentedComment #10
ricardoamaro CreditAttribution: ricardoamaro commentednew test with count and more output
Comment #12
ricardoamaro CreditAttribution: ricardoamaro commentedTrying again with chunks with 50
Comment #13
ricardoamaro CreditAttribution: ricardoamaro commentedanother patch
Comment #14
Sutharsan CreditAttribution: Sutharsan commentedI will put the status to 'Needs work' until we have completed successful tests with the new testbot command.
Comment #15
Sutharsan CreditAttribution: Sutharsan commentedFor testing purpose:
* reduced the chunk size to 1
* added debug messages
Comment #16
ricardoamaro CreditAttribution: ricardoamaro commentedError:
Comment #17
Sutharsan CreditAttribution: Sutharsan commentedWe overlooked another query that queries _all_ test results. Made a separate function that does the (chunked) loading.
Still at a variable limit of 1. Only if this passes on sqlite, we can start increasing the limit.
Comment #18
Sutharsan CreditAttribution: Sutharsan commentedStill failing ... Adding debug messages.
Comment #19
ricardoamaro CreditAttribution: ricardoamaro commentedComment #20
Sutharsan CreditAttribution: Sutharsan commented[edit: duplicate comment removed]
Comment #21
Sutharsan CreditAttribution: Sutharsan commentedAdded missing global
global $args;
.Comment #22
ricardoamaro CreditAttribution: ricardoamaro commentedTest is running
Comment #23
ricardoamaro CreditAttribution: ricardoamaro commentedThis seems to be working now:
http://testbot-pgsql.drupal-pt.org/sites/default/files/build_2014_09_29_...
Comment #24
Sutharsan CreditAttribution: Sutharsan commentedComment #25
Sutharsan CreditAttribution: Sutharsan commentedPrevious patch finally worked with sqlite.
Patch cleaned.
Comment #27
ricardoamaro CreditAttribution: ricardoamaro commentedComment #28
ricardoamaro CreditAttribution: ricardoamaro commentedComment #29
ricardoamaro CreditAttribution: ricardoamaro commentedThis is a blocker for the testbot, please commit when possible
Thank you
Comment #30
bzrudi71 CreditAttribution: bzrudi71 commentedJust startet local test run (just to make sure). Results will follow...
Comment #31
ricardoamaro CreditAttribution: ricardoamaro commented@bzrudi71 is your test done? ;)
This patch passed on all of my local tests
Comment #32
bzrudi71 CreditAttribution: bzrudi71 commented@ricardoamaro sorry no. Running --all on mysql seems to take ages ;-) I ran an 'aggregator' only test in front of full testing and that worked. However, I have seen a FATAL because of memory limit on http://testbot.drupal-pt.org earlier when trying to store the results. Let's see if it will happen to me also, and if, we need to higher the PHP memory_limit in web container I guess, but thats outside the scope of this patch...
Comment #33
ricardoamaro CreditAttribution: ricardoamaro commentedOK, Thanks!
Comment #34
bzrudi71 CreditAttribution: bzrudi71 commentedFinally ;-)
I get the mentioned memory_limit FATAL, but that's unrelated to this patch. I tried some test runs with some thousands of tests to make sure the patch is working properly, in terms of chunks - and it did. So from my side RTBC.
About this error:
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 4194304 bytes) in /var/www/core/scripts/run-tests.sh on line 1142
We need to file an issue in drupalci_testbot repo.
Comment #35
ricardoamaro CreditAttribution: ricardoamaro commentedRTBC for me also!
@Sutharsan please give your comment
Thanks all
Comment #36
Sutharsan CreditAttribution: Sutharsan commentedI've investigated the patch for memory consumption but found no possibility to significantly reduce the memory usage.
Comment #37
bzrudi71 CreditAttribution: bzrudi71 commented@Sutharsan Not that I have really investigated this patch, or looked deeper at the source, but can' we not just write the results chunk by chunk? I mean, instead of collection all results by array_merge(), why not write results if a chunk is processed/completed. This way we will free memory...
Comment #38
Sutharsan CreditAttribution: Sutharsan commented@bzrudi71, sure we can. But currently all messages are loaded first and then processes. So I suggest to open a new issue for your optimisation suggestion.
Comment #40
webchickAgreed that sounds like an optimization we could pursue in another issue.
As for this one, looks good.
Committed and pushed to 8.x. Thanks! Onward, testbotNG! :)