From b1426b4df886acbe22dbfb5473cfa0f4092fc109 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 15 Dec 2021 11:32:07 +0100 Subject: [PATCH] Try making tests a bit less transient --- .appveyor.yml | 4 ++-- .../Component/Console/Tests/ApplicationTest.php | 6 ++++++ .../Iterator/RecursiveDirectoryIteratorTest.php | 8 ++++---- .../Component/Lock/Tests/Store/PdoDbalStoreTest.php | 2 +- .../Contracts/HttpClient/Test/HttpClientTestCase.php | 12 ++++++------ 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 7fe5b25c3686e..cbb0098bcffbe 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -60,7 +60,7 @@ test_script: - SET SYMFONY_PHPUNIT_SKIPPED_TESTS=phpunit.skipped - copy /Y c:\php\php.ini-min c:\php\php.ini - IF %APPVEYOR_REPO_BRANCH:~-2% neq .x (rm -Rf src\Symfony\Bridge\PhpUnit) - - php phpunit src\Symfony --exclude-group tty,benchmark,intl-data || SET X=!errorlevel! + - php phpunit src\Symfony --exclude-group tty,benchmark,intl-data,network,transient-on-windows || SET X=!errorlevel! - copy /Y c:\php\php.ini-max c:\php\php.ini - - php phpunit src\Symfony --exclude-group tty,benchmark,intl-data || SET X=!errorlevel! + - php phpunit src\Symfony --exclude-group tty,benchmark,intl-data,network,transient-on-windows || SET X=!errorlevel! - exit %X% diff --git a/src/Symfony/Component/Console/Tests/ApplicationTest.php b/src/Symfony/Component/Console/Tests/ApplicationTest.php index 1634c01991b0a..6e9953dd27a7b 100644 --- a/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php @@ -894,6 +894,9 @@ public function testRenderExceptionLineBreaks() $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_linebreaks.txt', $tester->getDisplay(true), '->renderException() keep multiple line breaks'); } + /** + * @group transient-on-windows + */ public function testRenderAnonymousException() { $application = new Application(); @@ -917,6 +920,9 @@ public function testRenderAnonymousException() $this->assertStringContainsString('Dummy type "class@anonymous" is invalid.', $tester->getDisplay(true)); } + /** + * @group transient-on-windows + */ public function testRenderExceptionStackTraceContainsRootException() { $application = new Application(); diff --git a/src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php index 037810aea799f..f48cc941f8ad3 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php @@ -21,7 +21,7 @@ class RecursiveDirectoryIteratorTest extends IteratorTestCase public function testRewindOnFtp() { try { - $i = new RecursiveDirectoryIterator('ftp://speedtest.tele2.net/', \RecursiveDirectoryIterator::SKIP_DOTS); + $i = new RecursiveDirectoryIterator('ftp://speedtest:speedtest@ftp.otenet.gr/', \RecursiveDirectoryIterator::SKIP_DOTS); } catch (\UnexpectedValueException $e) { $this->markTestSkipped('Unsupported stream "ftp".'); } @@ -37,14 +37,14 @@ public function testRewindOnFtp() public function testSeekOnFtp() { try { - $i = new RecursiveDirectoryIterator('ftp://speedtest.tele2.net/', \RecursiveDirectoryIterator::SKIP_DOTS); + $i = new RecursiveDirectoryIterator('ftp://speedtest:speedtest@ftp.otenet.gr/', \RecursiveDirectoryIterator::SKIP_DOTS); } catch (\UnexpectedValueException $e) { $this->markTestSkipped('Unsupported stream "ftp".'); } $contains = [ - 'ftp://speedtest.tele2.net'.\DIRECTORY_SEPARATOR.'1000GB.zip', - 'ftp://speedtest.tele2.net'.\DIRECTORY_SEPARATOR.'100GB.zip', + 'ftp://speedtest:speedtest@ftp.otenet.gr'.\DIRECTORY_SEPARATOR.'test100Mb.db', + 'ftp://speedtest:speedtest@ftp.otenet.gr'.\DIRECTORY_SEPARATOR.'test100k.db', ]; $actual = []; diff --git a/src/Symfony/Component/Lock/Tests/Store/PdoDbalStoreTest.php b/src/Symfony/Component/Lock/Tests/Store/PdoDbalStoreTest.php index 264c99829c98f..49c2daf45c377 100644 --- a/src/Symfony/Component/Lock/Tests/Store/PdoDbalStoreTest.php +++ b/src/Symfony/Component/Lock/Tests/Store/PdoDbalStoreTest.php @@ -44,7 +44,7 @@ public static function tearDownAfterClass(): void */ protected function getClockDelay() { - return 1000000; + return 1500000; } /** diff --git a/src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php b/src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php index 7ebf055d75701..fd7ea1a007dde 100644 --- a/src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php +++ b/src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php @@ -813,16 +813,16 @@ public function testTimeoutWithActiveConcurrentStream() public function testTimeoutOnInitialize() { $p1 = TestHttpServer::start(8067); - $p2 = TestHttpServer::start(8077); + $p2 = TestHttpServer::start(8078); $client = $this->getHttpClient(__FUNCTION__); $start = microtime(true); $responses = []; $responses[] = $client->request('GET', 'http://localhost:8067/timeout-header', ['timeout' => 0.25]); - $responses[] = $client->request('GET', 'http://localhost:8077/timeout-header', ['timeout' => 0.25]); + $responses[] = $client->request('GET', 'http://localhost:8078/timeout-header', ['timeout' => 0.25]); $responses[] = $client->request('GET', 'http://localhost:8067/timeout-header', ['timeout' => 0.25]); - $responses[] = $client->request('GET', 'http://localhost:8077/timeout-header', ['timeout' => 0.25]); + $responses[] = $client->request('GET', 'http://localhost:8078/timeout-header', ['timeout' => 0.25]); try { foreach ($responses as $response) { @@ -846,16 +846,16 @@ public function testTimeoutOnInitialize() public function testTimeoutOnDestruct() { $p1 = TestHttpServer::start(8067); - $p2 = TestHttpServer::start(8077); + $p2 = TestHttpServer::start(8078); $client = $this->getHttpClient(__FUNCTION__); $start = microtime(true); $responses = []; $responses[] = $client->request('GET', 'http://localhost:8067/timeout-header', ['timeout' => 0.25]); - $responses[] = $client->request('GET', 'http://localhost:8077/timeout-header', ['timeout' => 0.25]); + $responses[] = $client->request('GET', 'http://localhost:8078/timeout-header', ['timeout' => 0.25]); $responses[] = $client->request('GET', 'http://localhost:8067/timeout-header', ['timeout' => 0.25]); - $responses[] = $client->request('GET', 'http://localhost:8077/timeout-header', ['timeout' => 0.25]); + $responses[] = $client->request('GET', 'http://localhost:8078/timeout-header', ['timeout' => 0.25]); try { while ($response = array_shift($responses)) {