-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
[5.3] Fix TokenMisMatch error. #15224
Conversation
@@ -339,7 +339,7 @@ public function testSharedGet() | |||
$result *= $status; | |||
} | |||
|
|||
$this->assertTrue($result === 1); | |||
$this->assertFalse($result === 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test was breaking here. That's why i have added it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update this to something that actually tests the result?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think only boolean is being returned. If i write $this->assertTrue($result)
or $this->assertFalse($result)
tests always returns an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't compare the result against 1. Assert what it actually is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we need more explanation as to why the test was breaking in the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file_put_contents does not support share lock and the lock parameter will not work.
Thus, it may result in some processes are reading data when other process are writing in the same time.
This doesn't fix it. It just breaks it to hide the error really. |
I just installed a fresh copy of 5.3 and this issue happens constantly. Is there a solution for this? |
Just to point out Symfony's |
Fixes TokenMismatch Exception as reported in #15040, I can confirm this has happened a couple of times when installing a fresh Laravel 5.3 application. @MountainDev provided the fix here. So adding PR for its inclusion into the framework.