Skip to content

Commit 326f3dd

Browse files
author
Bulat Shakirzyanov
committed
print retry attempts
1 parent e95fabd commit 326f3dd

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

features/bootstrap/FeatureContext.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,25 +161,23 @@ public function aFileNamedWith($name, PyStringNode $string)
161161
$this->createFile($this->workingDir.'/'.$name, (string) $string);
162162
}
163163

164-
/**
165-
* @Given a running web server
166-
*/
167-
public function aRunningWebServer()
168-
{
169-
$this->startWebServer();
170-
}
171-
172164
/**
173165
* @When I go to :path
174166
*/
175167
public function iGoTo($path)
176168
{
169+
if (!$this->webServerProcess) {
170+
$this->startWebServer();
171+
}
177172

178173
for ($retries = 1; $retries <= 10; $retries++) {
179174
$contents = @file_get_contents($this->webServerURL.$path);
180175

181176
if ($contents === false) {
182-
sleep($retries * 0.4);
177+
$wait = $retries * 0.4;
178+
printf("Unable to fetch %s, attempt %d, retrying in %d\n",
179+
$path, $retries, $wait);
180+
sleep($wait);
183181
continue;
184182
}
185183

features/sessions/persistent_sessions.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Feature: Persistent Sessions
1111
1212
echo phpinfo();
1313
"""
14-
And a running web server
1514

1615
Scenario: No sessions have been created
1716
When I go to "/status.php"

0 commit comments

Comments
 (0)