-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Lock] fix locale dependent test case #27755
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still failing on OSX though
ipcs: illegal option -- u
ipcs: usage: ipcs [-abcmopqstMQST]
man
says
A portable application shall not use the -a, -b, -o, -l, and -u options
should be fixed by an OSX user : ) |
On OS X, IPC status from <running system> as of Fri Jun 29 17:43:01 CEST 2018
T ID KEY MODE OWNER GROUP
Semaphores: followed by a list of active semaphores. So a patch for OS X could be: diff --git a/src/Symfony/Component/Lock/Tests/Store/SemaphoreStoreTest.php b/src/Symfony/Component/Lock/Tests/Store/SemaphoreStoreTest.php
index 7057505..fb42e5a 100644
--- a/src/Symfony/Component/Lock/Tests/Store/SemaphoreStoreTest.php
+++ b/src/Symfony/Component/Lock/Tests/Store/SemaphoreStoreTest.php
@@ -50,6 +50,14 @@ class SemaphoreStoreTest extends AbstractStoreTest
private function getOpenedSemaphores()
{
+ if ('Darwin' === PHP_OS) {
+ $lines = explode(PHP_EOL, trim(`ipcs -s`));
+ if (-1 === $start = array_search('Semaphores:', $lines)) {
+ throw new \Exception('Failed to extract list of opend semaphores. Expect a Semaphore list, got '.implode(PHP_EOL, $lines));
+ }
+ return \count(\array_slice($lines, ++$start));
+ }
+
$lines = explode(PHP_EOL, trim(`LC_ALL=C ipcs -su`));
if ('------ Semaphore Status --------' !== $lines[0]) {
throw new \Exception('Failed to extract list of opend semaphores. Expect a Semaphore status, got '.implode(PHP_EOL, $lines)); |
This PR was merged into the 3.4 branch. Discussion ---------- [Lock] fix locale dependent test case | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Right now, I get a failure with `Exception: Failed to extract list of opend semaphores. Expect a Semaphore status, got ------ États des sémaphores --------` :) Commits ------- e665da0 [Lock] fix locale dependent test case
@ogizanagi PR welcome, the commit should be for you :) |
This PR was merged into the 3.4 branch. Discussion ---------- [Lock] Fix SemaphoreStoreTest on OS X | Q | A | ------------- | --- | Branch? | 3.4 <!-- see below --> | Bug fix? | no | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #27755 (review) <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | N/A As spotted in #27755 (review), for OS X. If other OS X users could give it a try (`/phpunit src/Symfony/Component/Lock/ --filter=SemaphoreStoreTest`), that would be awesome. Commits ------- 9055611 [Lock] Fix SemaphoreStoreTest on OS X
Right now, I get a failure with
Exception: Failed to extract list of opend semaphores. Expect a Semaphore status, got ------ États des sémaphores --------
:)