Skip to content

Conversation

GrahamCampbell
Copy link
Contributor

@GrahamCampbell GrahamCampbell commented Aug 25, 2019

Closes #186.

@GrahamCampbell
Copy link
Contributor Author

Hmm, wait this still isn't correct...

@nicolas-grekas
Copy link
Member

Thank you @GrahamCampbell.

nicolas-grekas added a commit that referenced this pull request Nov 27, 2019
This PR was squashed before being merged into the 1.13-dev branch.

Discussion
----------

Ensure hrtime is monotonic

Closes #186.

Commits
-------

1158d83 Ensure hrtime is monotonic
@nicolas-grekas nicolas-grekas merged commit 1158d83 into symfony:master Nov 27, 2019
@GrahamCampbell
Copy link
Contributor Author

Thanks for finishing this off! :)

@GrahamCampbell GrahamCampbell deleted the patch-1 branch November 27, 2019 14:48
@nicolas-grekas
Copy link
Member

nicolas-grekas commented Nov 27, 2019

oups, this breaks tests on 7.4, if you want to have a look.

@GrahamCampbell
Copy link
Contributor Author

Unrelated, but when I run the tests on my machine, I get a load of warnings before they start:

PHP Warning:  Use of undefined constant UUID_TYPE_RANDOM - assumed 'UUID_TYPE_RANDOM' (this will throw an Error in a future version of PHP) in /data/tests/Uuid/UuidTest.php on line 34
PHP Warning:  Use of undefined constant UUID_TYPE_TIME - assumed 'UUID_TYPE_TIME' (this will throw an Error in a future version of PHP) in /data/tests/Uuid/UuidTest.php on line 35
PHP Warning:  Use of undefined constant UUID_TYPE_NULL - assumed 'UUID_TYPE_NULL' (this will throw an Error in a future version of PHP) in /data/tests/Uuid/UuidTest.php on line 122
PHP Warning:  Use of undefined constant UUID_TYPE_RANDOM - assumed 'UUID_TYPE_RANDOM' (this will throw an Error in a future version of PHP) in /data/tests/Uuid/UuidTest.php on line 123
PHP Warning:  Use of undefined constant UUID_TYPE_TIME - assumed 'UUID_TYPE_TIME' (this will throw an Error in a future version of PHP) in /data/tests/Uuid/UuidTest.php on line 124
PHP Warning:  Use of undefined constant UUID_TYPE_TIME - assumed 'UUID_TYPE_TIME' (this will throw an Error in a future version of PHP) in /data/tests/Uuid/UuidTest.php on line 125
PHP Warning:  Use of undefined constant UUID_TYPE_NULL - assumed 'UUID_TYPE_NULL' (this will throw an Error in a future version of PHP) in /data/tests/Uuid/UuidTest.php on line 139
PHP Warning:  Use of undefined constant UUID_VARIANT_DCE - assumed 'UUID_VARIANT_DCE' (this will throw an Error in a future version of PHP) in /data/tests/Uuid/UuidTest.php on line 140
PHP Warning:  Use of undefined constant UUID_VARIANT_DCE - assumed 'UUID_VARIANT_DCE' (this will throw an Error in a future version of PHP) in /data/tests/Uuid/UuidTest.php on line 141

@GrahamCampbell
Copy link
Contributor Author

All the tests pass on my PHP 7.2, 7.3, and 7.4. I guess Travis just has an old version.

@GrahamCampbell
Copy link
Contributor Author

PHPUnit 7.5.17 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.2.24
Configuration: /data/phpunit.xml.dist

SSS..........................................................   61 / 1206 (  5%)
.............................................................  122 / 1206 ( 10%)
.............................................................  183 / 1206 ( 15%)
.............................................................  244 / 1206 ( 20%)
......................................................SSSSSSS  305 / 1206 ( 25%)
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS  366 / 1206 ( 30%)
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS....  427 / 1206 ( 35%)
..............SSSS................S..........................  488 / 1206 ( 40%)
............SSSSSS..................SSS.......SSSSS..........  549 / 1206 ( 45%)
..................SSSSSSSSSSSSSSSSSSSSS......................  610 / 1206 ( 50%)
.............................................................  671 / 1206 ( 55%)
.............................................................  732 / 1206 ( 60%)
.............................................................  793 / 1206 ( 65%)
.............................................................  854 / 1206 ( 70%)
.............................................................  915 / 1206 ( 75%)
.............................................................  976 / 1206 ( 80%)
................................SSSS......................... 1037 / 1206 ( 85%)
......................................................SSS.... 1098 / 1206 ( 91%)
.........................................SSSSSSSSSSSSS

Time: 1.92 seconds, Memory: 20.00 MB
PHPUnit 7.5.17 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.3.11
Configuration: /data/phpunit.xml.dist

SSS..........................................................   61 / 1206 (  5%)
.............................................................  122 / 1206 ( 10%)
.............................................................  183 / 1206 ( 15%)
.............................................................  244 / 1206 ( 20%)
......................................................SSSSSSS  305 / 1206 ( 25%)
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS  366 / 1206 ( 30%)
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS....  427 / 1206 ( 35%)
..............SSSS................S..........................  488 / 1206 ( 40%)
............SSSSSS..................SSS......................  549 / 1206 ( 45%)
..................SSSSSSSSSSSSSSSSSSSSS......................  610 / 1206 ( 50%)
.............................................................  671 / 1206 ( 55%)
.............................................................  732 / 1206 ( 60%)
.............................................................  793 / 1206 ( 65%)
.............................................................  854 / 1206 ( 70%)
.............................................................  915 / 1206 ( 75%)
.............................................................  976 / 1206 ( 80%)
................................SSSS......................... 1037 / 1206 ( 85%)
......................................................SSS.... 1098 / 1206 ( 91%)
.........................................SSSSSSSSSSSSS

Time: 2.89 seconds, Memory: 20.00 MB
PHPUnit 7.5.17 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.4.0RC6
Configuration: /data/phpunit.xml.dist

SSS..........................................................   61 / 1206 (  5%)
.............................................................  122 / 1206 ( 10%)
.............................................................  183 / 1206 ( 15%)
.............................................................  244 / 1206 ( 20%)
......................................................SSSSSSS  305 / 1206 ( 25%)
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS  366 / 1206 ( 30%)
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS....  427 / 1206 ( 35%)
..............SSSS...........................................  488 / 1206 ( 40%)
............SSSSSS..................SSS......................  549 / 1206 ( 45%)
.......................SSSSSSSSSSSSSSSS......................  610 / 1206 ( 50%)
.............................................................  671 / 1206 ( 55%)
.............................................................  732 / 1206 ( 60%)
.............................................................  793 / 1206 ( 65%)
.............................................................  854 / 1206 ( 70%)
.............................................................  915 / 1206 ( 75%)
.............................................................  976 / 1206 ( 80%)
................................SSSS......................... 1037 / 1206 ( 85%)
......................................................SSS.... 1098 / 1206 ( 91%)
.........................................SSSSSSSSSSSSS

Time: 2.82 seconds, Memory: 22.01 MB

nicolas-grekas added a commit that referenced this pull request Nov 27, 2019
This PR was merged into the 1.13-dev branch.

Discussion
----------

[UUID] Fixed tests when the PECL is not available

fixes #187 (comment)

Commits
-------

400dcea [UUID] Fixed tests when the PECL is not available
nicolas-grekas added a commit that referenced this pull request Nov 27, 2019
…" (nicolas-grekas)

This PR was merged into the 1.13-dev branch.

Discussion
----------

Revert "bug #187 Ensure hrtime is monotonic (GrahamCampbell)"

This reverts commit 64d2d7d, reversing
changes made to b501e55.

/cc @GrahamCampbell FYI I just realized the implementation doesn't work:
microtime(false) return something like `0.00018200 1574780469`
casting this to float and comparing with the previous checks only the sub-seconds part. But it should account for seconds too.
That's why tests fail transiently on the CI.

Maybe we don't care about monotonicity eventually, do we?

Commits
-------

ae4fd2b Revert "bug #187 Ensure hrtime is monotonic (GrahamCampbell)"
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.

Incorrect implementation of hrtime
3 participants