Skip to content
Permalink
Browse files

Fix flacky test. Close #21.

  • Loading branch information
dunglas committed Oct 15, 2019
1 parent 0204833 commit e655c2d21c6be69fb462f59d14a715cd1e01dc3d
@@ -22,7 +22,7 @@
}],
], [
'Request: "GET ' . GATEWAY_URL . '/books.jsonld"',
'Response: "200 ' . GATEWAY_URL . '/books.jsonld"',
'Request: "GET ' . GATEWAY_URL . '/books/1.jsonld"',
'Response: "200 ' . GATEWAY_URL . '/books.jsonld"',
'Response: "200 ' . GATEWAY_URL . '/books/1.jsonld"',
]);
@@ -21,11 +21,11 @@
}
}],
], [
'Request: "GET ' . GATEWAY_URL . '/books.jsonld"',
'Accepting pushed response: "GET ' . GATEWAY_URL . '/books/1.jsonld"',
'Queueing pushed response: "' . GATEWAY_URL . '/authors/1.jsonld"',
'Queueing pushed response: "' . GATEWAY_URL . '/books/1.jsonld"',
'Queueing pushed response: "' . GATEWAY_URL . '/books/2.jsonld"',
'Queueing pushed response: "' . GATEWAY_URL . '/authors/1.jsonld"',
'Request: "GET ' . GATEWAY_URL . '/books.jsonld"',
'Response: "200 ' . GATEWAY_URL . '/books.jsonld"',
'Accepting pushed response: "GET ' . GATEWAY_URL . '/books/1.jsonld"',
'Response: "200 ' . GATEWAY_URL . '/books/1.jsonld"',
]);
@@ -21,11 +21,11 @@
}
}],
], [
'Request: "GET ' . GATEWAY_URL . '/books.jsonld?fields=/hydra:member/*/author&preload=/hydra:member/*/author"',
'Queueing pushed response: "' . GATEWAY_URL . '/authors/1.jsonld"',
'Queueing pushed response: "' . GATEWAY_URL . '/books/1.jsonld?fields=%2Fauthor&preload=%2Fauthor"',
'Queueing pushed response: "' . GATEWAY_URL . '/books/2.jsonld?fields=%2Fauthor&preload=%2Fauthor"',
'Queueing pushed response: "' . GATEWAY_URL . '/authors/1.jsonld"',
'Response: "200 ' . GATEWAY_URL . '/books.jsonld?fields=/hydra:member/*/author&preload=/hydra:member/*/author"',
'Request: "GET ' . GATEWAY_URL . '/books.jsonld?fields=/hydra:member/*/author&preload=/hydra:member/*/author"',
'Request: "GET ' . GATEWAY_URL . '/books/1.jsonld?fields=%2Fauthor"',
'Response: "200 ' . GATEWAY_URL . '/books.jsonld?fields=/hydra:member/*/author&preload=/hydra:member/*/author"',
'Response: "200 ' . GATEWAY_URL . '/books/1.jsonld?fields=%2Fauthor"',
]);
@@ -22,7 +22,7 @@
}],
], [
'Request: "GET ' . GATEWAY_URL . '/books.jsonld?fields=/hydra:member/*/author"',
'Response: "200 ' . GATEWAY_URL . '/books.jsonld?fields=/hydra:member/*/author"',
'Request: "GET ' . GATEWAY_URL . '/books/1.jsonld?fields=%2Fauthor"',
'Response: "200 ' . GATEWAY_URL . '/books.jsonld?fields=/hydra:member/*/author"',
'Response: "200 ' . GATEWAY_URL . '/books/1.jsonld?fields=%2Fauthor"',
]);
@@ -9,15 +9,15 @@
['/books/2.jsonld', ['headers' => ['Preload' => '/author']]],
['/authors/1.jsonld'],
], [
'Request: "GET ' . GATEWAY_URL . '/books.jsonld"',
'Accepting pushed response: "GET ' . GATEWAY_URL . '/authors/1.jsonld"',
'Accepting pushed response: "GET ' . GATEWAY_URL . '/books/1.jsonld"',
'Accepting pushed response: "GET ' . GATEWAY_URL . '/books/2.jsonld"',
'Queueing pushed response: "' . GATEWAY_URL . '/authors/1.jsonld"',
'Queueing pushed response: "' . GATEWAY_URL . '/books/1.jsonld"',
'Queueing pushed response: "' . GATEWAY_URL . '/books/2.jsonld"',
'Queueing pushed response: "' . GATEWAY_URL . '/authors/1.jsonld"',
'Request: "GET ' . GATEWAY_URL . '/books.jsonld"',
'Response: "200 ' . GATEWAY_URL . '/authors/1.jsonld"',
'Response: "200 ' . GATEWAY_URL . '/books.jsonld"',
'Accepting pushed response: "GET ' . GATEWAY_URL . '/books/1.jsonld"',
'Response: "200 ' . GATEWAY_URL . '/books/1.jsonld"',
'Accepting pushed response: "GET ' . GATEWAY_URL . '/books/2.jsonld"',
'Response: "200 ' . GATEWAY_URL . '/books/2.jsonld"',
'Accepting pushed response: "GET ' . GATEWAY_URL . '/authors/1.jsonld"',
'Response: "200 ' . GATEWAY_URL . '/authors/1.jsonld"',
]);
@@ -9,15 +9,15 @@
'/books/2.jsonld?preload=%2Fauthor',
'/authors/1.jsonld',
], [
'Request: "GET ' . GATEWAY_URL . '/books.jsonld?preload=/hydra:member/*/author"',
'Accepting pushed response: "GET ' . GATEWAY_URL . '/authors/1.jsonld"',
'Accepting pushed response: "GET ' . GATEWAY_URL . '/books/1.jsonld?preload=%2Fauthor"',
'Accepting pushed response: "GET ' . GATEWAY_URL . '/books/2.jsonld?preload=%2Fauthor"',
'Queueing pushed response: "' . GATEWAY_URL . '/authors/1.jsonld"',
'Queueing pushed response: "' . GATEWAY_URL . '/books/1.jsonld?preload=%2Fauthor"',
'Queueing pushed response: "' . GATEWAY_URL . '/books/2.jsonld?preload=%2Fauthor"',
'Queueing pushed response: "' . GATEWAY_URL . '/authors/1.jsonld"',
'Request: "GET ' . GATEWAY_URL . '/books.jsonld?preload=/hydra:member/*/author"',
'Response: "200 ' . GATEWAY_URL . '/authors/1.jsonld"',
'Response: "200 ' . GATEWAY_URL . '/books.jsonld?preload=/hydra:member/*/author"',
'Accepting pushed response: "GET ' . GATEWAY_URL . '/books/1.jsonld?preload=%2Fauthor"',
'Response: "200 ' . GATEWAY_URL . '/books/1.jsonld?preload=%2Fauthor"',
'Accepting pushed response: "GET ' . GATEWAY_URL . '/books/2.jsonld?preload=%2Fauthor"',
'Response: "200 ' . GATEWAY_URL . '/books/2.jsonld?preload=%2Fauthor"',
'Accepting pushed response: "GET ' . GATEWAY_URL . '/authors/1.jsonld"',
'Response: "200 ' . GATEWAY_URL . '/authors/1.jsonld"',
]);
@@ -11,8 +11,8 @@
assertRequests([
['/books.jsonld', ['headers' => ['Preload' => '/hydra:member/*/author']]],
], [
'Request: "GET ' . GATEWAY_URL . '/books.jsonld"',
'Queueing pushed response: "' . GATEWAY_URL . '/books/1.jsonld"',
'Queueing pushed response: "' . GATEWAY_URL . '/books/2.jsonld"',
'Request: "GET ' . GATEWAY_URL . '/books.jsonld"',
'Response: "200 ' . GATEWAY_URL . '/books.jsonld"',
]);
@@ -11,8 +11,8 @@
assertRequests([
['/oa/books.json', ['headers' => ['Preload' => '/member/*']]],
], [
'Request: "GET ' . GATEWAY_URL . '/oa/books.json"',
'Queueing pushed response: "' . GATEWAY_URL . '/oa/books/1"',
'Queueing pushed response: "' . GATEWAY_URL . '/oa/books/2"',
'Request: "GET ' . GATEWAY_URL . '/oa/books.json"',
'Response: "200 ' . GATEWAY_URL . '/oa/books.json"',
]);
@@ -48,6 +48,7 @@ public function log($level, $message, array $context = [])

echo implode("\n", $logger->logs) . "\n";

sort($logger->logs);
if ($logger->logs !== $expectedLogs) {
fwrite(STDERR, (new Differ())->diff(implode("\n", $expectedLogs), implode("\n", $logger->logs)));
exit(1);

0 comments on commit e655c2d

Please sign in to comment.
You can’t perform that action at this time.