8000 minor #39720 make some time dependent tests more resilient (xabbuh) · symfony/symfony@9b719ab · GitHub
[go: up one dir, main page]

Skip to content

Commit 9b719ab

Browse files
minor #39720 make some time dependent tests more resilient (xabbuh)
This PR was merged into the 4.4 branch. Discussion ---------- make some time dependent tests more resilient | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Commits ------- a33850e make some time dependent tests more resilient
2 parents eb74e5e + a33850e commit 9b719ab

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Symfony/Component/Config/Tests/Resource/DirectoryResourceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function testIsFreshDeleteFile()
110110
{
111111
$resource = new DirectoryResource($this->directory);
112112
$time = time();
113-
sleep(1);
113+
usleep(1500000);
114114
unlink($this->directory.'/tmp.xml');
115115
$this->assertFalse($resource->isFresh($time), '->isFresh() returns false if an existing file is removed');
116116
}

src/Symfony/Component/Mailer/Tests/Transport/Smtp/SmtpTransportTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
use Symfony\Component\Mime\Exception\InvalidArgumentException;
2323
use Symfony\Component\Mime\RawMessage;
2424

25+
/**
26+
* @group time-sensitive
27+
*/
2528
class SmtpTransportTest extends TestCase
2629
{
2730
public function testToString()
@@ -83,7 +86,7 @@ public function testSendDoesPingAboveThreshold()
8386
$this->assertNotContains("NOOP\r\n", $stream->getCommands());
8487

8588
$stream->clearCommands();
86-
sleep(1);
89+
usleep(1500000);
8790

8891
$transport->send(new RawMessage('Message 3'), $envelope);
8992
$this->assertContains("NOOP\r\n", $stream->getCommands());

0 commit comments

Comments
 (0)
0