Skip to content

Commit de223a8

Browse files
author
catch
committed
Issue #3400150 by mstrelan, quietone: [random test failure] TimestampFormatterWithTimeDiffTest::testTimestampFormatterWithTimeDiff
1 parent 5adae20 commit de223a8

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

tests/Drupal/FunctionalJavascriptTests/Core/Field/TimestampFormatterWithTimeDiffTest.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ protected function setUp(): void {
8888
* Tests the 'timestamp' formatter when is used with time difference setting.
8989
*/
9090
public function testTimestampFormatterWithTimeDiff(): void {
91-
$this->markTestSkipped("Skipped due to frequent random test failures. See https://www.drupal.org/project/drupal/issues/3400150");
9291
$this->drupalGet($this->entity->toUrl());
9392

9493
// Unit testing Drupal.timeDiff.format(). Not using @dataProvider mechanism
@@ -120,15 +119,15 @@ public function testTimestampFormatterWithTimeDiff(): void {
120119
$time_diff = $time_element->getText();
121120
[$seconds_value] = explode(' ', $time_diff, 2);
122121

123-
// Wait at least 1 second + 1 millisecond to make sure that the last time
124-
// difference value has been refreshed.
125-
$this->assertJsCondition("document.getElementsByTagName('time')[0].textContent != '$time_diff'", 1001);
122+
// Wait up to 2 seconds to make sure that the last time difference value
123+
// has been refreshed.
124+
$this->assertJsCondition("document.getElementsByTagName('time')[0].textContent != '$time_diff'", 2000);
126125
$time_diff = $time_element->getText();
127126
[$new_seconds_value] = explode(' ', $time_diff, 2);
128127
$this->assertGreaterThan($seconds_value, $new_seconds_value);
129128

130129
// Once again.
131-
$this->assertJsCondition("document.getElementsByTagName('time')[0].textContent != '$time_diff'", 1001);
130+
$this->assertJsCondition("document.getElementsByTagName('time')[0].textContent != '$time_diff'", 2000);
132131
$time_diff = $time_element->getText();
133132
$seconds_value = $new_seconds_value;
134133
[$new_seconds_value] = explode(' ', $time_diff, 2);

tests/Drupal/FunctionalJavascriptTests/Core/Field/TimestampFormatterWithTimeDiffViewsTest.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class TimestampFormatterWithTimeDiffViewsTest extends WebDriverTestBase {
3636
* Tests the timestamp formatter used with time difference setting in views.
3737
*/
3838
public function testTimestampFormatterWithTimeDiff(): void {
39-
$this->markTestSkipped("Skipped due to frequent random test failures. See https://www.drupal.org/project/drupal/issues/3400150");
4039
ViewTestData::createTestViews(self::class, ['views_test_formatter']);
4140

4241
$data = $this->getRowData();
@@ -67,9 +66,9 @@ public function testTimestampFormatterWithTimeDiff(): void {
6766
$this->assertMatchesRegularExpression($regex_pattern, $time_diff);
6867
}
6968

70-
// Wait at least 1 second + 1 millisecond to make sure the 'right now' time
71-
// difference was refreshed.
72-
$this->assertJsCondition("document.querySelector('.entity-$delta time').textContent >= '$time_diff'", 1001);
69+
// Wait up to 2 seconds to make sure the 'right now' time difference was
70+
// refreshed.
71+
$this->assertJsCondition("document.querySelector('.entity-$delta time').textContent >= '$time_diff'", 2000);
7372
}
7473

7574
/**

0 commit comments

Comments
 (0)