Support to #2942900: Convert JavascriptTestBase Tests to use DrupalSelenium2Driver.

Before the mass transfer PhantomJS tests to Selenium, we need to make sure that they work no less stably than before.

CommentFileSizeAuthor
#12 c-15-2942900-check-stability.patch99.63 KBAnonymous (not verified)
#12 default-shuffle-revert-optimize.png42.25 KBAnonymous (not verified)
#10 2942900-79-concurrency-16.patch91.22 KBAnonymous (not verified)
#10 2942900-79-concurrency-14.patch91.22 KBAnonymous (not verified)
#10 2942900-79-concurrency-13.patch91.22 KBAnonymous (not verified)
#10 2942900-79-concurrency-12.patch91.22 KBAnonymous (not verified)
#9 2942900-79-concurrency-21.patch91.22 KBAnonymous (not verified)
#9 2942900-79-concurrency-19.patch91.22 KBAnonymous (not verified)
#9 2942900-79-concurrency-17.patch91.22 KBAnonymous (not verified)
#9 2942900-79-concurrency-15.patch91.22 KBAnonymous (not verified)
#8 2942900-79-slower-tweak-4.patch92.45 KBAnonymous (not verified)
#7 2942900-79-slower-tweak-3.patch92.45 KBAnonymous (not verified)
#6 2942900-79-slower-tweak-2.patch89.6 KBAnonymous (not verified)
#5 2942900-79-slower-tweak.patch90.09 KBAnonymous (not verified)
#3 c17-all-js-selenium-tweak.patch99.78 KBAnonymous (not verified)
#3 c14-all-js-selenium-tweak.patch99.78 KBAnonymous (not verified)
#3 c8-all-js-selenium-tweak.patch99.78 KBAnonymous (not verified)
#3 c5-all-js-selenium-tweak.patch99.78 KBAnonymous (not verified)
#2 c20-all-js-selenium-tweak.patch99.78 KBAnonymous (not verified)
#2 c10-all-js-selenium-tweak.patch99.78 KBAnonymous (not verified)
#2 c1-all-js-selenium-tweak.patch99.78 KBAnonymous (not verified)

Comments

Anonymous’s picture

vaplas created an issue. See original summary.

Anonymous’s picture

#2942900-63: Convert JavascriptTestBase Tests to use DrupalSelenium2Driver looks like some reorder of the tests (see run-tests.sh) leads to CI aborted with 36 concurrency (#30). Let's check with other value of concurrency.

Edit:
Probably Selenium very strongly eats some kind of resources. Here are the statistics with different concurrency (edit: the statistics are not very reliable, because I forgot about the random interval WebDriverCurlService 😥):

  • 1 - 25 min 26 sec
  • 5 - 5 min 38 sec
  • 8 - 4 min 30 sec
  • 10 - 4 min 43 sec
  • 14 - 4 min 30 sec
  • 17 - 4 min 22 sec
  • 20 - 5 min 12 sec (❓ 20 slower than 10 concurrency?)
  • 36 - 5 min 6 sec (#30 sometimes CI Aborted)

On my local machine, Apache also throws out the white flag after 10 minutes, when I test this patch with 30 concurrency.


Edit 2:

+++ b/core/tests/Drupal/FunctionalJavascriptTests/WebDriverCurlService.php
@@ -0,0 +1,113 @@
+        $result = json_decode($rawResult, TRUE);
+        if (isset($result['status']) && $result['status'] === WebDriverException::STALE_ELEMENT_REFERENCE) {
+          usleep(rand(100000, 1000000));
+          $retries++;
+          continue;
+        }
+        return [$rawResult, $info];
+      }
+      catch (CurlExec $exception) {
+        $retries++;

Perhaps with increasing concurrency just more collisions in curl requests.

Anonymous’s picture

Wow, simultaneous launch 17 concurrency in 6 different PHP/DB versions - works great!

dawehner’s picture

Thank you so much for doing this research!

Anonymous’s picture

StatusFileSize
new90.09 KB

@dawehner, thank you too!

Let's check tests with slow css/js files (0.5 s) and delay with response (0.5 s). Added to the beginning of the patch.

Anonymous’s picture

StatusFileSize
new89.6 KB
Anonymous’s picture

StatusFileSize
new92.45 KB
Anonymous’s picture

StatusFileSize
new92.45 KB
Anonymous’s picture

Anonymous’s picture

lendude’s picture

Go @vaplas go! Nice work.

Even with the improvement, it seems SettingsTray test still takes up most of the time, so setting higher concurrency won't help improve things drastically if its run last or takes up more time then all the other tests running on the remaining processes.

01:40:10 Drupal\Tests\settings_tray\FunctionalJavascript\QuickEditInt 2 passes
01:43:00 Drupal\Tests\settings_tray\FunctionalJavascript\SettingsTray 3 passes
01:43:00
01:43:00 Test run duration: 4 min 52 sec

Anonymous’s picture

))) Thanks!

Fails in 2942900-79-concurrency-13.patch upset the whole thing :( I do not know exactly how to deal with them yet.

It would be nice to rename the module settings_tray to a_settings_tray :)

By the wicked irony, the most slowest tests we run at the very end. Recently I experimented with a different order of launching tests, and found out that we can save 7 minutes only by changing the order of execution for Functional + Kernel + Unit:


This is no longer so relevant after #2969363: Add a drupalci.yml to core. I just wanted to share the picture.


Let's check what happens if we decouple SettingsTrayBlockFormTest on 3 tests:

  • SettingsTrayBlockFormTest
  • SettingsTrayBlockFormEditModeTest
  • SettingsTrayBlockFormValidationMessagesTest

And set reverse order.

Edit:

10:47:30 Drupal\Tests\field_layout\FunctionalJavascript\FieldLayoutTe 4 passes
10:49:05 Drupal\Tests\settings_tray\FunctionalJavascript\SettingsTray 1 passes
10:49:05
10:49:05 Test run duration: 4 min 16 sec

Now the difference is only 1:30. But I guess it's enough just to revert the order without decouple (or do it later). Because after few new heavy tests, this difference will disappear. Example new tests from:

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

cilefen’s picture

Status: Active » Postponed (maintainer needs more info)

Almost four years have passed with no updates. Is this issue (a support request) still a "thing"?

cilefen’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)