summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/form.inc4
-rw-r--r--modules/simpletest/simpletest.module7
2 files changed, 9 insertions, 2 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 037bb9ee6..62b9876d0 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -2544,8 +2544,8 @@ function batch_set($batch_definition) {
* Unless the batch has been marked with 'progressive' = FALSE, the function
* issues a drupal_goto and thus ends page execution.
*
- * This function is not needed in form submit handlers; Form API takes care
- * of batches that were set during form submission.
+ * This function is generally not needed in form submit handlers;
+ * Form API takes care of batches that were set during form submission.
*
* @param $redirect
* (optional) Path to redirect to when the batch has finished processing.
diff --git a/modules/simpletest/simpletest.module b/modules/simpletest/simpletest.module
index c7504cca8..372ad1f3f 100644
--- a/modules/simpletest/simpletest.module
+++ b/modules/simpletest/simpletest.module
@@ -337,6 +337,13 @@ function simpletest_run_tests($test_list, $reporter = 'drupal') {
'init_message' => t('SimpleTest is initializing...') . ' ' . format_plural(count($test_list), "one test case will run.", "@count test cases will run."),
);
batch_set($batch);
+ // Normally, the forms portion of the batch API takes care of calling
+ // batch_process(), but in the process it saves the whole $form into the
+ // database (which is huge for the test selection form).
+ // By calling batch_process() directly, we skip that behavior and ensure
+ // that we don't exceed the size of data that can be sent to the database
+ // (max_allowed_packet on MySQL).
+ batch_process();
}
/**