Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Skip transient tests on macos #44643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"

echo COLUMNS=120 >> $GITHUB_ENV
echo PHPUNIT="$(pwd)/phpunit --exclude-group tty,benchmark,intl-data" >> $GITHUB_ENV
echo PHPUNIT="$(pwd)/phpunit --exclude-group tty,benchmark,intl-data$([[ ${{ matrix.os }} = macos* ]] && echo ',transient-on-macos')" >> $GITHUB_ENV
echo COMPOSER_UP='composer update --no-progress --ansi' >> $GITHUB_ENV

SYMFONY_VERSIONS=$(git ls-remote -q --heads | cut -f2 | grep -o '/[1-9][0-9]*\.[0-9].*' | sort -V)
Expand Down
18 changes: 12 additions & 6 deletions src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -810,19 +810,22 @@ public function testTimeoutWithActiveConcurrentStream()
}
}

/**
* @group transient-on-macos
*/
public function testTimeoutOnInitialize()
{
$p1 = TestHttpServer::start(8067);
$p2 = TestHttpServer::start(8078);
$p2 = TestHttpServer::start(8077);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why changing the port ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverting #44636 which apparently doesn't work


$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:8078/timeout-header', ['timeout' => 0.25]);
$responses[] = $client->request('GET', 'http://localhost:8077/timeout-header', ['timeout' => 0.25]);
$responses[] = $client->request('GET', 'http://localhost:8067/timeout-header', ['timeout' => 0.25]);
$responses[] = $client->request('GET', 'http://localhost:8078/timeout-header', ['timeout' => 0.25]);
$responses[] = $client->request('GET', 'http://localhost:8077/timeout-header', ['timeout' => 0.25]);

try {
foreach ($responses as $response) {
Expand All @@ -843,19 +846,22 @@ public function testTimeoutOnInitialize()
}
}

/**
* @group transient-on-macos
*/
public function testTimeoutOnDestruct()
{
$p1 = TestHttpServer::start(8067);
$p2 = TestHttpServer::start(8078);
$p2 = TestHttpServer::start(8077);

$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:8078/timeout-header', ['timeout' => 0.25]);
$responses[] = $client->request('GET', 'http://localhost:8077/timeout-header', ['timeout' => 0.25]);
$responses[] = $client->request('GET', 'http://localhost:8067/timeout-header', ['timeout' => 0.25]);
$responses[] = $client->request('GET', 'http://localhost:8078/timeout-header', ['timeout' => 0.25]);
$responses[] = $client->request('GET', 'http://localhost:8077/timeout-header', ['timeout' => 0.25]);

try {
while ($response = array_shift($responses)) {
Expand Down