I have a contributed module that executes some operations in a batch during the module installation. It works fine when I enable the module with Drush or from Drupal UI (/admin/modules). The problem appears when I want to enable the module when running tests. In this case we have already a running batch and the batch from my module will be executed just after the batch from Simpletest, therefore after all tests will run.
This can be fixed restoring Simpletest's batch after modules installation in WebTestBase::setUp(), not before this. Attached a patch.
Comment | File | Size | Author |
---|---|---|---|
#8 | 2464283-8-restore-batch-fix.patch | 3.53 KB | jeqq |
#2 | 2464283-2-restore-batch-fix.patch | 3.86 KB | jeqq |
restore-batch-fix.patch | 937 bytes | jeqq | |
Comments
Comment #1
dixon_@jeqq Would it be possible to include a simple test for this fix? Perhaps a test in
core/modules/simpletest/src/Tests
?Comment #2
jeqqThanks @dixon_! Added a test for this.
Comment #3
dixon_Considering that this feature (i.e. running batch jobs during module install) works in the Drupal UI as well as in Drush, I think it's safe to say that this is a bug in our testing framework that should be fixed.
Marking as bug.
Patch looks good, so also marking as RTBC.
Comment #6
asgorobets CreditAttribution: asgorobets commentedComment #7
alexpottWeird formatting
Too many new lines
I don't think we need empty module files anymore.
Comment #8
jeqqThanks @alexpott. Fixed.
Comment #9
dixon_Issues are addressed, back to RTBC.
Comment #11
jeqqComment #13
dixon_Comment #16
dixon_Comment #17
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed e2aaf40 and pushed to 8.0.x. Thanks!