Skip to content

[Lock] Adjust lock delay to avoid false error tests #22119

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

Merged
merged 1 commit into from
Mar 22, 2017

Conversation

jderusse
Copy link
Member

@jderusse jderusse commented Mar 22, 2017

Q A
Branch? master
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

Adjust the clockDelay to fix tests
This test is here to:

T0.

  • Fork A, B, C

T1.

  • A acquire Lock then start sleeping for 3*clockDelay
  • B start sleeping for 1*clockDelay
  • C start sleeping for 1*clockDelay

T2

  • B wakeup AND try to acquire lock in wait mode
  • C wakeup AND try to acquire lock in non wait mode (lock should be till acquired by A)

T4

  • A release Lock
  • B acquire lock and release it

At the end, this tests assert than:

  • A acquire and delete the lock
  • B acquire and delete the lock
  • C failed to acquire the lock

The point is, this test is time sensitive, and if the fork is too slow, A, B and C are not synchronized and C is able to acquire Lock.

This PR adjuste clock delay to reduce false failures

@jderusse jderusse mentioned this pull request Mar 22, 2017
@jderusse jderusse changed the title [WIP] [Lock] Adjust lock delay to avoid false error tests [Lock] Adjust lock delay to avoid false error tests Mar 22, 2017
@jderusse jderusse force-pushed the lock-adjust-clockdelay branch from 0a11ecc to 33f2a9a Compare March 22, 2017 22:42
@fabpot
Copy link
Member

fabpot commented Mar 22, 2017

Thank you @jderusse.

@fabpot fabpot merged commit 33f2a9a into symfony:master Mar 22, 2017
fabpot added a commit that referenced this pull request Mar 22, 2017
…russe)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[Lock] Adjust lock delay to avoid false error tests

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

Adjust the clockDelay to fix tests
This test is here to:

T0.
* Fork A, B, C

T1.
* A acquire Lock then start sleeping for 3*clockDelay
* B start sleeping for 1*clockDelay
* C start sleeping for 1*clockDelay

T2
* B wakeup AND try to acquire lock in wait mode
* C wakeup AND try to acquire lock in non wait mode (lock should be till acquired by A)

T4
* A release Lock
* B acquire lock and release it

At the end, this tests assert than:
* A acquire and delete the lock
* B acquire and delete the lock
* C failed to acquire the lock

The point is, this test is time sensitive, and if the fork is too slow, A, B and C are not synchronized and C is able to acquire Lock.

This PR adjuste clock delay to reduce false failures

Commits
-------

33f2a9a Adjust lock delay to avoid false error tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants