Add an automated way for slow tests to fail drupalci builds

Created on 15 March 2019, about 6 years ago
Updated 9 September 2023, over 1 year ago

Problem/Motivation

Scoped to simpletest module because we still don't have a generalized testing component.

In #3038901: Speed up the tests on DrupalCI by not running slow tests last โ†’ we formalized adding @group #slow to tests which take a long time to run. This way we can prioritize them to run early.

In that issue we discussed how to determine which tests should be marked as #slow.

We can collect data about test speed, as per #3033037: DrupalCI should track and display job run times โ†’ and #2943340: Process PHPUnit junit reports separately โ†’ , but these do not provide feedback at patch-evaluation time as to whether a given test needs to be marked as #slow.

A suggested solution is to add a test listener which times tests, and if a threshhold is exceeded and the test is not already annotated with @group #slow, fail the test with an explanation.

When working on a slow environment that unnecessarily fails slow test, it is possible to disable the detection of slow tests by setting the environmental variable DRUPAL_TEST_DISABLE_TIME_LIMIT to 'true' in your phpunit.xml.

Proposed resolution

Add a listener that can be disabled with and env variable

Remaining tasks

none

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ“Œ Task
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
PHPUnitย  โ†’

Last updated 1 day ago

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States mile23 Seattle, WA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024