Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Lock] Fix race condition in tests between cache and lock component#23958

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

@jderusse
Copy link
Member

@jderussejderusse commentedAug 23, 2017
edited
Loading

QA
Branch?3.4
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PR

Currently trying to fix

  • php 5.5 in testSaveWithDifferentResources "Failed asserting that false is true"
  • php 5.5 in testSaveWithDifferentKeysOnSameResources "The store shouldn't save the second key"

Workflow:

@jderussejderusseforce-pushed thelock-fix-php56-memcached branch 10 times, most recently frombf0ed7b to0e4ca67CompareAugust 23, 2017 14:04
@nicolas-grekasnicolas-grekas added this to the3.4 milestoneAug 23, 2017
@jderussejderusseforce-pushed thelock-fix-php56-memcached branch 17 times, most recently fromeb6c9ee to03fce7eCompareAugust 23, 2017 21:33
@jderussejderusseforce-pushed thelock-fix-php56-memcached branch 4 times, most recently from598be05 tobdae8d7CompareAugust 23, 2017 22:15
@jderusse
Copy link
MemberAuthor

Issue spotted: This is a race condition with Cache's tests. (run in parallel in the travis test suite).

Redis is flushed (regardless the namespace) at the end of each tests. For instance

publicstaticfunctiontearDownAfterClass()
{
self::$redis->flushDB();
self::$redis =null;
}

Memcache does not take the namespace into account in the doClear method

protectedfunctiondoClear($namespace)
{
return$this->checkResultCode($this->client->flush());
}
. This method is called several time by the methodtestBasicUsage,testClear,testClearWithDeferredItems and all other tests due to the call in theteardown method.

For the redis tests, I think we can remove the usage offlushDb in tests as performed in my PR. But for memcached, I have no replacement ping@nicolas-grekas. (BTW is it expected that calling clear on a namespaces adapter removes items from other namespaces?)

Other fix: do not runCache andLock in parallele.

@jderusse
Copy link
MemberAuthor

Memecached fixed by#23969

@jderussejderusseforce-pushed thelock-fix-php56-memcached branch 5 times, most recently fromf594d3e toecc7ca5CompareSeptember 3, 2017 12:38
@jderussejderusseforce-pushed thelock-fix-php56-memcached branch fromecc7ca5 toe6f3fffCompareSeptember 3, 2017 12:45
@jderussejderusse changed the title[WIP] [Lock] Fix php 5 + memcached test faillure[Lock] Fix race condition in tests between cache and lock componentSep 3, 2017
@nicolas-grekasnicolas-grekas modified the milestones:3.4,3.3Sep 3, 2017
@nicolas-grekas
Copy link
Member

Thank you@jderusse.

nicolas-grekas added a commit that referenced this pull requestSep 3, 2017
…k component (jderusse)This PR was submitted for the 3.4 branch but it was merged into the 3.3 branch instead (closes#23958).Discussion----------[Lock] Fix race condition in tests between cache and lock component| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |Currently trying to fix* [x] php 5.5 in testSaveWithDifferentResources "Failed asserting that false is true"* [x] php 5.5 in testSaveWithDifferentKeysOnSameResources "The store shouldn't save the second key"Workflow:* [x] find a reproducer* [x] fix memcached tests =>#23969* [x] fix redis tests => this PRCommits-------26948cf Fix race condition in tests between cache and lock
@nicolas-grekas
Copy link
Member

Merged in 3.3

@jderussejderusse deleted the lock-fix-php56-memcached branchAugust 2, 2019 12:17
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

3 participants

@jderusse@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp