There's some mixup on which lock to acquire and which to release. Patch is coming.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | interdiff.txt | 1.13 KB | chx |
| #14 | 1976172_14.patch | 5.52 KB | chx |
| #6 | 1976172-6.patch | 2.39 KB | andypost |
There's some mixup on which lock to acquire and which to release. Patch is coming.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | interdiff.txt | 1.13 KB | chx |
| #14 | 1976172_14.patch | 5.52 KB | chx |
| #6 | 1976172-6.patch | 2.39 KB | andypost |
Comments
Comment #1
chx commentedComment #3
chx commentedComment #4
andypostIs this still valid? test passes so whats wrong?
Comment #5
chx commentedComment #6
andypostRe-roll after #1893772: Move entity-type specific storage logic into entity classes
I don't see a way to test this, because you need to detect that lock is acquired in
Comment::preSave()beforeComment::postSave()executedComment #7
chx commentedmmmm tests.
Comment #8
chx commentedI found a way to simplify.
Comment #9
chx commentedWith PSR-0 compliance. Verified to run with
phpunit --debug --group Drupal |grep CommentLockTest. Previously I was just running this single class.Comment #10
andypostAwesome! Test actually covers that
Comment #11
larowlanAre these needed? I thought each phpunit test ran in a separate instance? If so can we get a comment as to why?
Comment #12
chx commentedI have no idea how much simpletest and phpunit integrates and whether removing that breaks, for example, the GUI runner. Even if unnecessary, I think it's best practice to not leave such a container behind.
We have a lot of discussions right now over the new phpunit page which touches on this as well and I think it's better to commit this useful patch and powerful test example then remove later if we decide unnecessary than let all this linger just because of three lines of code that might not do anything. Note it can't cause any harm.
Comment #13
tim.plunkettThere is a --process-isolation flag for PHPUnit which defaults to FALSE, so unfortunately this is necessary.
We do need to reset the container, but we don't usually do it in the test method.
PHPUnit has both tearDown() and tearDownAfterClass(), and our container resets look like this:
Comment #14
chx commentedOK we can do that.
Comment #15
tim.plunkettLooks great, thanks!
Comment #16
catchCommitted/pushed to 8.x, thanks!