From b658d18b518fa4ac9a669244a81848fbd0c4816b Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Fri, 29 Jan 2021 12:45:00 +0800 Subject: [PATCH] MDL-66979 behat: Mark some tests as being slow Uses of the httpsreplace and customlang tools are known to be extremely slow. In our CI infrastructure on slwoer DBs, the customlang tool can take over 90 seconds to load the page, whilst the httpsreplace tool can take up to about 60 seconds. These changes set appropriate timeout factors to increase the timeout accordingly. --- .../tool/customlang/tests/behat/customisation_create.feature | 5 ++++- admin/tool/customlang/tests/behat/export.feature | 4 ++++ admin/tool/customlang/tests/behat/import_files.feature | 5 ++++- admin/tool/customlang/tests/behat/import_mode.feature | 5 ++++- admin/tool/httpsreplace/tests/behat/httpsreplace.feature | 5 ++++- 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/admin/tool/customlang/tests/behat/customisation_create.feature b/admin/tool/customlang/tests/behat/customisation_create.feature index 84f71bb8ba9..1d139473593 100644 --- a/admin/tool/customlang/tests/behat/customisation_create.feature +++ b/admin/tool/customlang/tests/behat/customisation_create.feature @@ -5,7 +5,10 @@ Feature: Within a moodle instance, an administrator should be able to modify lan I need to be able to access and change values in the the language customisation of the language pack. Background: - Given I log in as "admin" + # This is a very slow running test and on slow databases can take minutes to complete. + Given I mark this test as slow setting a timeout factor of 4 + + And I log in as "admin" And I navigate to "Language > Language customisation" in site administration And I set the field "lng" to "en" And I press "Open language pack for editing" diff --git a/admin/tool/customlang/tests/behat/export.feature b/admin/tool/customlang/tests/behat/export.feature index a42e6722b08..8ff826d5b30 100644 --- a/admin/tool/customlang/tests/behat/export.feature +++ b/admin/tool/customlang/tests/behat/export.feature @@ -4,6 +4,10 @@ Feature: Within a moodle instance, an administrator should be able to export mod As an admin I need to be able to export the php-files of the language customisation of a language. + Background: + # This is a very slow running feature and on slow databases can take minutes to complete. + Given I mark this test as slow setting a timeout factor of 4 + @javascript Scenario: Export button should not appear if no customization is made Given I log in as "admin" diff --git a/admin/tool/customlang/tests/behat/import_files.feature b/admin/tool/customlang/tests/behat/import_files.feature index 20df1c0f675..3d93dfec90f 100644 --- a/admin/tool/customlang/tests/behat/import_files.feature +++ b/admin/tool/customlang/tests/behat/import_files.feature @@ -5,7 +5,10 @@ Feature: Within a moodle instance, an administrator should be able to import mod I need to be able to import the zips and php files of the language customisation of a language. Background: - Given I log in as "admin" + # This is a very slow running test and on slow databases can take minutes to complete. + Given I mark this test as slow setting a timeout factor of 4 + + And I log in as "admin" And I navigate to "Language > Language customisation" in site administration And I set the field "lng" to "en" And I click on "Import custom strings" "button" diff --git a/admin/tool/customlang/tests/behat/import_mode.feature b/admin/tool/customlang/tests/behat/import_mode.feature index 2347cf24e9d..e977237a5e8 100644 --- a/admin/tool/customlang/tests/behat/import_mode.feature +++ b/admin/tool/customlang/tests/behat/import_mode.feature @@ -5,8 +5,11 @@ Feature: Within a moodle instance, an administrator should be able to import lan I need to be able to import only some language customisation strings depending on some conditions. Background: + # This is a very slow running feature and on slow databases can take minutes to complete. + Given I mark this test as slow setting a timeout factor of 4 + # Add one customization. - Given I log in as "admin" + And I log in as "admin" And I navigate to "Language > Language customisation" in site administration And I set the field "lng" to "en" And I press "Open language pack for editing" diff --git a/admin/tool/httpsreplace/tests/behat/httpsreplace.feature b/admin/tool/httpsreplace/tests/behat/httpsreplace.feature index 76e77e0f8f7..f8d99f95059 100644 --- a/admin/tool/httpsreplace/tests/behat/httpsreplace.feature +++ b/admin/tool/httpsreplace/tests/behat/httpsreplace.feature @@ -5,7 +5,10 @@ Feature: View the httpsreplace report I need to be able to automatically replace http links Background: Create some http links - Given I am on site homepage + # This is a slow running feature and on slow databases can take over 30 seconds to complete. + Given I mark this test as slow setting a timeout factor of 2 + + And I am on site homepage And the following "courses" exist: | fullname | shortname | category | summary | | Course 1 | C1 | 0 | |