Skip to content

[Process] Failing process timing test using usleep #16988

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

Closed
flip111 opened this issue Dec 12, 2015 · 1 comment
Closed

[Process] Failing process timing test using usleep #16988

flip111 opened this issue Dec 12, 2015 · 1 comment

Comments

@flip111
Copy link
Contributor

flip111 commented Dec 12, 2015

I'm doing a bit of guess work here based on this failed unit test. Seems that the test uses usleep . Also i noticed (on my own machine) phpunit launches a ton of parallel processes. Take on top of that we don't know for sure what appveyor is running on 1 CPU. So that means a lot of processes are in contention for CPU time. So i guess that could be a cause here. If it is, below are some relevant links

https://github.com/php/php-src/blob/250938e2d35fc54161a18167b7901c5e3b574371/win32/time.c#L101-L113

https://msdn.microsoft.com/en-us/library/windows/desktop/ms687032%28v=vs.85%29.aspx

Note that a ready thread is not guaranteed to run immediately. Consequently, the thread may not run until some time after the sleep interval elapses. For more information, see Scheduling Priorities.

https://msdn.microsoft.com/en-us/library/windows/desktop/ms686298%28v=vs.85%29.aspx

@nicolas-grekas
Copy link
Member

I fully agree here: we should try to make tests less volatile by not relying on usleep/time-ordering as much as possible

fabpot added a commit that referenced this issue Dec 23, 2015
…-grekas)

This PR was merged into the 2.3 branch.

Discussion
----------

[Process] More robustness and deterministic tests

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #16988, #15617
| License       | MIT
| Doc PR        | -

Commits
-------

d1a178a [Process] More robustness and deterministic tests
@fabpot fabpot closed this as completed Dec 23, 2015
nicolas-grekas added a commit that referenced this issue Dec 23, 2015
This PR was merged into the 2.7 branch.

Discussion
----------

[Process] Make tests more deterministic

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #16988
| License       | MIT
| Doc PR        | -

This makes running the Process tests faster and more deterministic.

Commits
-------

0dc9389 [Process] Make tests more deterministic
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

No branches or pull requests

3 participants