Drupal 7 issue for #2747075: [meta] Improve WebTestCase / BrowserTestBase performance by 50%

Problem/Motivation

- Tests are slow and installation takes a long time (both for d.org test runs and local development)
- Backdrop found out that installation is deterministic and can easily be cached per profile

Credit: https://github.com/backdrop/backdrop/pull/1366

Their patch works, but is preparing for a known set of profiles instead of demand.

Proposed resolution

- Introduce --cache option for BC compatibility
- Cache database tables and files after installation
- Re-use cache when it exists
- Prevent race conditions with transactions
- Also add --cache-modules for local development only

99% of people don't change the database data or schema during development, so the cache will work fine.

Remaining tasks

- Get it committed to Drupal 7

User interface changes

- None, commandline only. UI change can be follow-up

API changes

- None

Profiling of setUp()

Before is without cache.

--cache

--cache-modules

CommentFileSizeAuthor
#81 2759197-simpletest-perf-63-reroll-81.patch15.33 KBjoelpittet
#80 2759197-simpletest-perf-63-reroll-80.patch15.29 KBjoelpittet
#64 DO-NOT-USE-TEST-ONLY-cache-2759197-simpletest-perf-64.patch15.3 KBStevel
#64 DO-NOT-USE-TEST-ONLY-cache-modules-2759197-simpletest-perf-64.patch15.28 KBStevel
#63 2759197-simpletest-perf-63-interdiff.patch4.03 KBStevel
#63 2759197-simpletest-perf-63.patch15.32 KBStevel
#54 DO-NOT-USE-TEST-ONLY-cache-modules-2759197-simpletest-perf-54.patch16.15 KBfabianx
#54 DO-NOT-USE-TEST-ONLY-2759197-simpletest-perf-54.patch16.18 KBfabianx
#51 2759197-simpletest-perf-51.patch16.2 KBlarowlan
#51 interdiff-63f154.txt772 byteslarowlan
#40 d7_improve-2759197-40.patch16.25 KBfabianx
#36 d7_pp_1_improve-2759197-36.patch17.26 KBfabianx
#36 interdiff.txt15.04 KBfabianx
#29 d7_pp_1_improve-2759197-29-test-dorg.patch15.21 KBfabianx
#29 d7_pp_1_improve-2759197-29.patch15.14 KBfabianx
#29 interdiff.txt496 bytesfabianx
#25 d7_pp_1_improve-2759197-25--test-dorg.patch14.72 KBfabianx
#25 d7_pp_1_improve-2759197-25.patch14.66 KBfabianx
#25 interdiff.txt493 bytesfabianx
#23 d7_improve-2759197-22--test-dorg.patch15.21 KBfabianx
#23 d7_improve-2759197-22.patch15.14 KBfabianx
#23 interdiff.txt3.25 KBfabianx
#21 d7_improve-2759197-21.patch13.78 KBfabianx
#21 interdiff.txt3.84 KBfabianx
#15 interdiff-11-15.txt1.09 KBmpdonadio
#15 d7_improve-2759197-15.patch14.06 KBmpdonadio
#13 d7_improve-2759197-13.patch1.09 KBmpdonadio
#11 d7_improve-2759197-11.patch13.9 KBfabianx
#11 interdiff.txt1.52 KBfabianx
#9 d7_improve-2759197-9.patch14.71 KBfabianx
#9 critical-path-unchanged.txt2.88 KBfabianx
#9 interdiff.txt741 bytesfabianx
#8 d7-faster-setUp--cache-2.png96.7 KBfabianx
#7 d7-faster-setUp--cache-modules.png99.19 KBfabianx
#7 d7-faster-setUp--cache.png98.88 KBfabianx
#2 d7_improve-2759197-2.patch14.63 KBfabianx
#2 interdiff.txt8.44 KBfabianx

Comments

Fabianx created an issue. See original summary.

fabianx’s picture

StatusFileSize
new8.44 KB
new14.63 KB
fabianx’s picture

Issue tags: +Drupal 7.50 target
fabianx’s picture

fabianx’s picture

Status: Active » Needs work
+++ b/includes/module.inc
@@ -460,6 +460,7 @@ function module_enable($module_list, $enable_dependencies = TRUE) {
+      drupal_static_reset('drupal_get_schema_versions');

This should be fixed separately in a child issue.

stefan.r’s picture

I like the idea of this, it's fully opt-in, and if it's truly 50% that's a great improvement.

fabianx’s picture

Issue summary: View changes
StatusFileSize
new98.88 KB
new99.19 KB

Here are the benchmarks for one setUp() call with enabling common_test module (if not --cache-modules), but drupal_render() calls it 6 times (as there are 6 test* methods).

drupal_render() 62 passes, 0 fails, 0 exceptions, and 13 debug messages

Without cache:

Test run duration: 1 min 4 sec

With --cache:

Test run duration: 34 sec

And the diff to the version without cache (just setUp):

With --cache-modules:

Test run duration: 15 sec

And the diff to the version without cache (just setUp):

Need to work with Mixologic that we get the test runner --directory patch applied, so this can be tested.

fabianx’s picture

Issue summary: View changes
StatusFileSize
new96.7 KB

The --cache part did resetAll() twice. So the benchmark was off. Fixed in above comment.

And now we got the 50%.

fabianx’s picture

StatusFileSize
new741 bytes
new2.88 KB
new14.71 KB

Fixed the bug, showed that the critical path has not changed (critical-path-unchanged.txt; created with diff -w) and added interdiff.

mpdonadio’s picture

(optional) Convert tables to MyISAM to speed up DB copy and test runs

Won't this break transactions / rollbacks, or is there lack of test coverage for D7 with this area?

fabianx’s picture

StatusFileSize
new1.52 KB
new13.9 KB

Very good point!

Removed that and copy speed is thanks to the turn on indexes the same.

fabianx’s picture

Issue summary: View changes

#10:

Seems we don't have tests for that except for the tables that had been excluded, but I don't think it was that important.

mpdonadio’s picture

Status: Needs work » Needs review
StatusFileSize
new1.09 KB

I think this will also help the copy speed. The FK check is probably unneeded since there aren't proper FKs, but I think it will help.

Status: Needs review » Needs work

The last submitted patch, 13: d7_improve-2759197-13.patch, failed testing.

mpdonadio’s picture

StatusFileSize
new14.06 KB
new1.09 KB

That's what I get for trying to do this while I eat. This should be better.

mpdonadio’s picture

Status: Needs work » Needs review

/givesup

Status: Needs review » Needs work

The last submitted patch, 15: d7_improve-2759197-15.patch, failed testing.

gor’s picture

MyIssam will brake transactions for nodes.
But difference even on /dev/shm stored tables is huge enough to do exclude list.

That's why I originally added it to backdrop patch.

Fabian one more time! Well done! Dris made a right choice :)

gor’s picture

@Fabianx, I see that you got rid of profile related cache and generate cache on first test. Am I correct?

In first version I was doing the same but then I faced issue when some tests run under tests profile and another under standard.

As a result, cached tables did not represent proper set of modules, settings and test was failing.

That's why I included extra step as fake setUp before run tests and do it for each default profile.

fabianx’s picture

#15: It was not you, it was DrupalCI having a conflict due to #2551981: Add --directory option to run-tests.sh test discovery. However as DrupalCI does not have --cache for obvious reasons to test the speed-up on the CI, we need to hardcode $test->cache = TRUE inside the patch for now.

Thanks for your contribution!

#18: I do agree and the boost is huge. However as this code will also run for contrib project tests a fixed whitelist is unfortunately not possible.

#19: I resolved the problem of concurrency by using a transaction for the DB copying plus try {} catch. For parallel runs this gives a minimal performance loss of 2s (until the caches are primed), but ensures I don't need any complicated locking. The transaction also ensures that the cache is always consistent.

As for different caches per profile, that is why I use $this->profile as normal cache key and a normalized version of func_get_args() for the module cache key.

I am not sure why your implementation did not work, but as $this->profile is setup before installation, I cannot see where this would fail.

fabianx’s picture

Status: Needs work » Needs review
StatusFileSize
new3.84 KB
new13.78 KB

Unfortunately turning the checks off does not make the copy faster for me and the statements itself take 30 ms instead.

I found two flaws however and fixed them:

- Using a cache key suffix was not a good idea as it tried to copy the already cached tables as well. With a cache_key prefix, it works way better.
- Using a transaction won't work as DDL is non transactional in MySQL, so I removed it.

Uploading a new patch, which should pass as there should be no changes.

gor’s picture

#21 Yeah, concurrency issues with cache generation was a part of moving cache create process outside of tests.

fabianx’s picture

StatusFileSize
new3.25 KB
new15.14 KB
new15.21 KB

- Fixed concurrency problem using a different method (re-using semaphore table, but creating a new simpletest_semaphore table, which _only_ exists in the cache copy and is not copied over)
- Allowed cache to be re-created if e.g. the user pressed ctrl-c during storeCache()
- Warning the user if cache copy failed via a debug message, but not fataling

This works like a charm, now testing on d.org again.

fabianx’s picture

Title: [D7] Improve WebTestCase performance by 50% » [D7, PP-1] Improve WebTestCase performance by 50%
Status: Needs review » Postponed

Postponed for the bug fix for:

drupal_static_reset('drupal_get_schema_versions');

fabianx’s picture

Title: [D7, PP-1] Improve WebTestCase performance by 50% » [D7] Improve WebTestCase performance by 50%
Status: Postponed » Needs review
StatusFileSize
new493 bytes
new14.66 KB
new14.72 KB

Turns out the drupal_static_reset() is no longer needed as I cold not reproduce the error anymore and was just a problem due to me forgetting to module_load_all() after loading the cache.

Fixed in interdiff, therefore no longer blocked.

Testing test suite with --cache enabled on d.org again.

Status: Needs review » Needs work

The last submitted patch, 25: d7_pp_1_improve-2759197-25--test-dorg.patch, failed testing.

fabianx’s picture

Title: [D7] Improve WebTestCase performance by 50% » [D7, PP-1] Improve WebTestCase performance by 50%
Status: Needs work » Postponed

Oh, it seems it _is_ a problem after all.

I now could also reproduce it. The problem is that some kind of state is held between test runs even with vanilla Drupal 7:

e.g. if I change:

testUpdateAccess => ttestUpdateAccess, _then_ the test fails, too.

Also the wrong state is stored in cache.

E.g. I apply the fix, but have corrupted state in cache, then it fails, too.

Will open a child issue now.

fabianx’s picture

OMG I know why:

- After the first test has run all the modules install files are already loaded in memory, so function_exists() works obviously.

This means that drupal_get_schema_versions() is called for the module before its .install file has been loaded!

Because we never install some modules in the cached version, the schema is wrong then.

And the reason is that more modules could be loaded already than had install files loaded, which mostly is for core modules.

The reason is purely test based however:

module_list() uses a static, therefore it has the module_list of the host installation.

Therefore the first call to drupal_get_schema_versions() sets all modules that the host has to array(), e.g. block, node, ...

But the module list cannot be refreshed before the system table exists, therefore the test runner cannot refresh it prior to installation, but the installation of system module already leads to the problem then.

The static reset fixes it obviously, but could lead to performance penalty.

Another possibly is to module_load_install() before checking the schema version, but that also runs always.

The best way to fix this is to reset the schema versions when the module list is reset in system_install():

  // Clear out module list and hook implementation statics before calling
  // system_rebuild_theme_data().
  module_list(TRUE);
  module_implements('', FALSE, TRUE);

+  // Ensure the schema versions are not based on the old module list.
+  drupal_static_reset('drupal_get_schema_versions');

And that fixes the problem as well.

fabianx’s picture

Status: Postponed » Needs review
StatusFileSize
new496 bytes
new15.14 KB
new15.21 KB

Uploading a patch to see if its fixed.

Status: Needs review » Needs work

The last submitted patch, 29: d7_pp_1_improve-2759197-29-test-dorg.patch, failed testing.

fabianx’s picture

Status: Needs work » Needs review

The test fail looks unrelated.

fabianx’s picture

Self-reviewed as if I was reviewing this for commit:

  1. +++ b/modules/simpletest/drupal_web_test_case.php
    @@ -45,6 +45,20 @@ abstract class DrupalTestCase {
    +   * Whether to cache the setUp.
    ...
    +   * Whether to cache the setUp with modules installed.
    

    nit - These comments could be clearer. Ideas?

  2. +++ b/modules/simpletest/drupal_web_test_case.php
    @@ -1424,6 +1438,160 @@ class DrupalWebTestCase extends DrupalTestCase {
    +   * @return
    +   *   TRUE when the cache was used, FALSE when cache was not available.
    

    Missing return type.

  3. +++ b/modules/simpletest/drupal_web_test_case.php
    @@ -1424,6 +1438,160 @@ class DrupalWebTestCase extends DrupalTestCase {
    +    $cache_key = $this->getCacheKey($cache_key_prefix );
    

    nit - trailing "whitespace"

  4. +++ b/modules/simpletest/drupal_web_test_case.php
    @@ -1424,6 +1438,160 @@ class DrupalWebTestCase extends DrupalTestCase {
    +      $this->copyCache($cache_key, substr($this->databasePrefix, 10));
    

    This needs a try { } catch as well as copyCache() can throw an Exception().

    It might be even better to now put the try { catch } directly into copyCache().

  5. +++ b/modules/simpletest/drupal_web_test_case.php
    @@ -1424,6 +1438,160 @@ class DrupalWebTestCase extends DrupalTestCase {
    +   *   The cache key to use, by default only based on profile.
    

    nit - $this->profile or on the profile used by the test.

  6. +++ b/modules/simpletest/drupal_web_test_case.php
    @@ -1424,6 +1438,160 @@ class DrupalWebTestCase extends DrupalTestCase {
    +    return '1cache_' . $cache_key_prefix . $this->profile;
    

    The prefix is already quite long, while 1cache is pretty explicit, it might be better to use:

    1c_

    to allow for longer table names as the 'simpletest' prefix and profile name and modules hash already have quite some length.

    I do agree though that it is good to use the profile to also show which cache this is as this improves debuggability - as if it was just a hash.

    --

    Should also add a comment that 1 is needed as first character to ensure proper cleanup.

  7. +++ b/modules/simpletest/drupal_web_test_case.php
    @@ -1424,6 +1438,160 @@ class DrupalWebTestCase extends DrupalTestCase {
    +    // Everyone is allowed to pass this step.
    

    This should explain a little more why it is important that everyone can pass this stage.

  8. +++ b/modules/simpletest/drupal_web_test_case.php
    @@ -1424,6 +1438,160 @@ class DrupalWebTestCase extends DrupalTestCase {
    +   * @param $from
    ...
    +   * @param $to
    

    Missing types.

  9. +++ b/modules/simpletest/drupal_web_test_case.php
    @@ -1424,6 +1438,160 @@ class DrupalWebTestCase extends DrupalTestCase {
    +   *   The prefixId / cacheKey from where to copy.
    ...
    +   *   The prefixId / cacheKey to where to copy.
    

    prefixId / cacheKey => prefix_id / cache_key

  10. +++ b/modules/simpletest/drupal_web_test_case.php
    @@ -1424,6 +1438,160 @@ class DrupalWebTestCase extends DrupalTestCase {
    +   * @param $src
    ...
    +   * @param $dest
    

    Missing types

  11. +++ b/modules/simpletest/drupal_web_test_case.php
    @@ -1424,6 +1438,160 @@ class DrupalWebTestCase extends DrupalTestCase {
    +  protected function recursiveCopy($src, $dst) {
    +    $dir = opendir($src);
    

    We use full descriptive parameter names in Drupal.

  12. +++ b/modules/simpletest/drupal_web_test_case.php
    @@ -1424,6 +1438,160 @@ class DrupalWebTestCase extends DrupalTestCase {
    +        if (is_dir($src . '/' . $file)) {
    +          $this->recursiveCopy($src . '/' . $file, $dst . '/' . $file);
    ...
    +          copy($src . '/' . $file, $dst . '/' . $file);
    

    Some helper variables would be nice.

  13. +++ b/modules/simpletest/drupal_web_test_case.php
    @@ -1476,57 +1644,108 @@ class DrupalWebTestCase extends DrupalTestCase {
    +      $this->assertTrue(TRUE, t('Using cache: @cache (@key)', array(
    

    nit - can use $this->pass() instead.

  14. +++ b/modules/simpletest/drupal_web_test_case.php
    @@ -1476,57 +1644,108 @@ class DrupalWebTestCase extends DrupalTestCase {
    +        '@cache' => ($use_modules_cache ? 'Modules Cache' : 'Normal Cache'),
    

    Normal Cache should be "Installation Cache" as that is what we cache.

  15. +++ b/modules/simpletest/drupal_web_test_case.php
    @@ -1476,57 +1644,108 @@ class DrupalWebTestCase extends DrupalTestCase {
    +      $this->resetAll();
    

    In theory this would not be needed, but there is a comment over there that cache tables need this change to properly register the new DB prefix, so we are running this when using --cache-modules.

    Removing this woulds save ~ 1 sec, too.

  16. +++ b/modules/simpletest/simpletest.module
    @@ -589,7 +589,7 @@ function simpletest_clean_temporary_directories() {
    +      if (is_dir($path) && (is_numeric($file) || strpos($file, '1cache_') === 0)) {
    

    If we do the 1cache_ change, this should be 1c_ as well.

    Also needs a comment.

  17. +++ b/scripts/run-tests.sh
    @@ -152,6 +152,19 @@ All arguments are long options.
    +  --cache     Cache result of setUp per installation profile. This will create
    ...
    +              Cache result of setUp per installation profile and installed
    

    nit - setUp => the test setup

  18. +++ b/scripts/run-tests.sh
    @@ -368,6 +385,8 @@ function simpletest_script_run_one_test($test_id, $test_class) {
    +    $test->cache = !empty($args['cache']);
    +    $test->cacheModules = !empty($args['cache-modules']);
    

    We already use a public property for the test results.

    This avoids having to add a setter / getter and also allows tests to opt-out of caching by setting $this->cache = FALSE; in their setUp() method.

stefan.r’s picture

May be prudent to keep 15 for now. As to 1, the short descriptions sound fine, but it could be nice to add a long description describing what those flags actually do.

stefan.r’s picture

I am fine with trying to get this into 7.50, but we need to clearly mark these options as experimental, and ensure no single line of code changes behavior with the options disabled (it doesn't look like it does).

fabianx’s picture

Issue tags: -Drupal 7.50 target

As this only affects tests, this does not need to make 7.50 to go in, but can go in afterwards as experimental option.

fabianx’s picture

StatusFileSize
new15.04 KB
new17.26 KB

Here is the cleanup with interdiff, etc.

Can still be reviewed if someone wants to.

Status: Needs review » Needs work

The last submitted patch, 36: d7_pp_1_improve-2759197-36.patch, failed testing.

fabianx’s picture

Title: [D7, PP-1] Improve WebTestCase performance by 50% » [D7] Improve WebTestCase performance by 50%

No longer blocked on the other issue, but needs to be rerolled now.

David_Rothstein’s picture

As this only affects tests, this does not need to make 7.50 to go in, but can go in afterwards as experimental option.

To expand on that, one thing we talked about was that a testing-only experimental feature can probably be committed to core at any time - because it won't affect live sites, and also because core/contrib tests tend to run off 7.x-dev which means the feature can be meaningfully used as soon as it's in, regardless of when the next release is.

We would still wait until 7.60 (or later) to consider making this a "non-experimental" feature.

fabianx’s picture

Status: Needs work » Needs review
StatusFileSize
new16.25 KB

Just a re-roll.

This needs some good reviews now.

fabianx’s picture

This is blocked on reviews now.

Mixologic’s picture

Test run duration: 9 min 46 sec for the last branch test vs
Test run duration: 9 min 51 sec for the patch in #40.

What happened to the speeds we were seeing in #29?

Test run duration: 6 min 27 sec
fabianx’s picture

#42: The thing is opt-in. You will need to put --cache for the test runner for that to work.

I hardcoded $this->cache = TRUE for the test run in #29. I can easily hard-code it again - but I think we tested performance on test bot enough now.

Mixologic’s picture

Ah. Thanks for explaining that. ++

mpdonadio’s picture

I had some suggestions in #13 for potentially speeding up the table copies. Did you get a chance to look at these? I'm not on my Drupal dev machine right now, or I would look at this again.

fabianx’s picture

#45: I have tried those, but as we disable / enable the keys already, this did not bring any further speedup for me.

hestenet’s picture

Issue tags: +needs port to Drupal 8
tobiasb’s picture

Drupal test run
---------------

Tests to be run:
 - Select or Other admin (SelectOrOtherAdminTestCase)
 - Select or Other number (SelectOrOtherNumberTestCase)
 - Select or Other Text (SelectOrOtherTextTestCase)
 - Select or Other Taxonomy (SelectOrOtherTaxonomyTestCase)

Before

Test run duration: 15 min 57 sec

After (--cache):

Test run duration: 12 min 35 sec

After (--cache-modules):

Test run duration: 7 min 27 sec
joseph.olstad’s picture

Wow, amazing numbers, seeing as the D8 and D7 tests are currently very slow and the test server is always overloaded, it seems like this patch should get more attention. We could run twice as many tests in the same time given the reported performance benefits it's two fold.

larowlan’s picture

This doesn't work for me because of table name length violations.

My profile name is 13 characters long.

So with the simplest_{hash} prefix, the $to_prefix is 36 characters.

With a table name like cache_entity_message_type_category, the overall table name length comes to 69 characters.

Which is larger than the 64 characters.

Will attempt to come up with an approach to mitigate.

larowlan’s picture

StatusFileSize
new772 bytes
new16.2 KB

I don't think we need to include the profile in the table name given it is already used in calculating the hash

This works for me.

Also dropped the underscores.

3 minute test takes 21 seconds on subsequent run.

Big profile, lots of features (lots of features processing during install).

fabianx’s picture

Nice, that change works for me :).

3 minute test takes 21 seconds on subsequent run.

With --cache or with --cache-modules? (just curious)

joseph.olstad’s picture

drupal.org could patch it's D7 test runners using #51, would really help speed up the testing, lighten the server load.

fabianx’s picture

Testing speed increase on test runners again (hardcoded --cache to TRUE and --cache-modules to true in other patch), DO NOT USE.

fabianx’s picture

  • Without: 12 min
  • --cache: 5 min 9 sec
  • --cache --cache-modules: 4 min 36 sec

The problem is that we need to get the Drupal 8 patch in first, before we can profit from it.

The other problem is that the Drupal 8 patch does not profit from raw installation caching as much as the Drupal 7 patch, so it is not secure to get in ...

jibran’s picture

Issue tags: +Needs change record

The problem is that we need to get the Drupal 8 patch in first, before we can profit from it.

I don't think d8 patch should block this issue.

+++ b/modules/simpletest/drupal_web_test_case.php
@@ -1448,6 +1462,181 @@ class DrupalWebTestCase extends DrupalTestCase {
+    file_put_contents($cache_file, time(NULL));

No need to pass anything to time function.

jibran’s picture

larowlan’s picture

With --cache or with --cache-modules

My base class has both set to true

Stevel’s picture

Status: Needs review » Needs work

There seems to be a problem when the database gets out of sync with the file system (for instance when you clean up the test environment).

There can be various reasons:
- The 'clean up' action checks for folders starting with '1c_', but the cache folders don't have an underscore. This is an easy fix: just check for folders starting with '1c' instead of '1c_' (or change the prefix to something else)
- The database is migrated from another environment (or restored from a backup). In this case, there are no database tables to start with. Perhaps the code in copySetupCache() should check that there are tables to copy, and return FALSE otherwise?

Another question about copySetupCache(): why is the simpletest_semaphore table skipped? This skip doens't seem necessary (and would break install profiles that enable the simpletest module (theoretical, none that I know of)

fabianx’s picture

#59: Good catch!

- #51 broke it, by removing the underscore.

- As we call it after an installation there should be tables to copy ...

- simpletest_semaphore is just an internal table to ensure not two processes try to gain the 'lock' to create the setup cache first. It is not part of the actual Drupal installation.

Leaving at CNW to revert parts of #51.

Stevel’s picture

  1. There are always tables to copy TO the cache, but it's possible that there are no tables to copy FROM the cache.
    Scenario to reproduce:
    • On a 'cleaned up' environment (no simpletest cache tables), backup the database
    • Run tests
    • Restore database from backup
    • Run tests again -> tests fail
  2. I see now that the semaphore table is created specifically for this use case. In the current version of the patch, the skip is useless, because the semaphore table is called e.g; 1c10f7d787simpletest_semaphore, while the other tables are e.g. simpletest1c10f7d787system.

    But why not use the original semaphore table and combine the cache prefix and name in the same column, instead of creating a table per cache id with a single row in it?

Stevel’s picture

Assigned: Unassigned » Stevel

Writing an updated patch...

Stevel’s picture

Assigned: Stevel » Unassigned
StatusFileSize
new15.32 KB
new4.03 KB
Stevel’s picture

And some patches that force the testbot to use the cache options.

Status: Needs review » Needs work

The last submitted patch, 63: 2759197-simpletest-perf-63.patch, failed testing. View results

The last submitted patch, 63: 2759197-simpletest-perf-63.patch, failed testing. View results

joseph.olstad’s picture

The testrunner is broken for D7, I've openned an issue:
Composer command failed
#2970950: D7 test runner not working since may 4th 2018 'Composer command failed'

I think it was caused by this:
#2968630-2: Send phpversion to the composer command

joseph.olstad’s picture

so ya, I think @Stevel patches are fine but they won't be able to be tested until testrunner gets fixed
Please feel free to make some noise in
#2970950: D7 test runner not working since may 4th 2018 'Composer command failed'
#2968630-2: Send phpversion to the composer command

The last submitted patch, 63: 2759197-simpletest-perf-63.patch, failed testing. View results

The last submitted patch, 63: 2759197-simpletest-perf-63-interdiff.patch, failed testing. View results

Status: Needs review » Needs work
joseph.olstad’s picture

test runner is fixed

marcelovani’s picture

What is the current situation with this issue?

fabianx’s picture

I am providing now a justification, why this can go into Drupal 7 even though it never entered Drupal 9:

- For Drupal 9 it's less useful, because we have minimal profile there so the (--cache) saves almost nothing
- --cache-modules would still be useful, but a large part of rebuilds is in the container, which varies a lot and is hard to cache (I tried really really hard but without further restrictions this just cannot be done efficiently)

So for Drupal 9 this is not really useful, but for Drupal 7 it saves a ton of time.

And even if we don't use it for testbot, anyone that still needs to run tests locally on D7 can profit from this.

So let's get this finally in and push it over the finish line.

fabianx’s picture

Issue tags: -needs port to Drupal 8
mcdruid’s picture

Issue tags: +Pending Drupal 7 commit

tagging so that we try to get this into the next release; will do a proper review of #63 beforehand

mcdruid’s picture

Issue tags: +Needs reroll

This needs a reroll, but I'm very keen to get it in to the next release.

joelpittet’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new15.29 KB

Reroll fuzzed well, here it is.

joelpittet’s picture

StatusFileSize
new15.33 KB

Hmm, maybe I wasn't up to date, anyway new fuzz

  • mcdruid committed 3c7c6de on 7.x
    Issue #2759197 by Fabianx, Stevel, mpdonadio, joelpittet, larowlan, gor...
mcdruid’s picture

Still needs a CR, but this is in. Thanks everyone!

Very happy that this was my 100th commit to core :)

joseph.olstad’s picture

Great work @mcdruid, thanks!

  • mcdruid committed 59384c7 on 7.x
    Issue #2759197 by mcdruid: Fix typos in help text for run-tests script
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.