Skip to content
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

Fix tests on macOS #1120

Merged
merged 3 commits into from
Oct 28, 2023
Merged

Conversation

danepowell
Copy link
Contributor

I'll admit I don't quite understand why this is failing, but I'm guessing no one has actually run tests on macOS recently and this broke sometime along the way.

@theofidry
Copy link
Member

I'll be honest... I have no clue neither, looks like it's failing for me now... I'll try to check it again

@theofidry
Copy link
Member

Now I am getting:

-    'timestamp' => 1680317060
+    'timestamp' => 1680284660

And launching this in psysh I'm getting:

> (new SplFileInfo('fixtures/phar/simple.zip'))->getMTime()
= 1697988274

> (new PharData('fixtures/phar/simple.zip'))->getMTime()
= 1680284660

So frankly I don't quite get it

@danepowell
Copy link
Contributor Author

danepowell commented Oct 23, 2023

@theofidry a shot in the dark here... what's the value of PHP_OS_FAMILY on your machine?

I wonder if you're using a cross-compiled version of PHP on MacOS and getting bit by tivie/php-os-detector#3

If that's the case, we should consider dropping the use of PHP_OS_FAMILY for something more reliable, as I've had to do in the past: acquia/blt#3750

@theofidry
Copy link
Member

@theofidry a shot in the dark here... what's the value of PHP_OS_FAMILY on your machine?

PHP_OS_FAMILY = PHP_OS = 'Darwin'

The PHP binary has been compiled by https://github.com/phpbrew/phpbrew on this very machine.

But... wow yeah that's an edge case alright

@danepowell
Copy link
Contributor Author

danepowell commented Oct 24, 2023

I'll try to take a deeper look at these tests later this week if you don't get to it sooner. I'm on a Macbook M1, macOS 13.6, running brew php. I'm guessing the difference has to do with one of these versions.

@danepowell
Copy link
Contributor Author

I didn't realize you'd added the macOS conditional just a day earlier: #1104

Anyway... I think this timestamp you referenced is the last modified time of the zip file, which is basically when you checked it out from the repo: 1697988274

I think the timestamp for the phar is based on the txt file inside, which is either 1680317060 or 1680284660.

The fact that these are exactly 9 hours apart makes me think this is a timezone issue. Like, some version of the zlib library (provided on macOS) isn't handling timezone conversion correctly.

@danepowell
Copy link
Contributor Author

Congratulations, I think we've stumbled across a PHP bug: php/php-src#12532

@theofidry
Copy link
Member

Thanks very much for looking into this and opening the issue! It's unfortunate it's a PHP bug, but I'm happy it's not me going crazy!

@danepowell
Copy link
Contributor Author

This should be good to go. Perhaps you can restart the rate-limited tests.

@theofidry theofidry merged commit 5f23cd8 into box-project:main Oct 28, 2023
196 of 203 checks passed
@theofidry
Copy link
Member

Thanks a lot @danepowell! really glad to see one of those pestering issues gone 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants