Problem/Motivation
Our PhpStorage tests currently write directly to the computers temporary directory. This is problematic and we don't even tear down and clean up so we leave files laying around. Personally this also means I can't run threaded tests against issues I'm watching because tests running in another process can remove the file from underneath a test running in a separate process.
History, and review help, the tests where done this way because tempnam doesn't work well with filestreams http://php.net/tempnam#97086. Sadly we can't use our implementation of tempnam that does support filestreams because it requires a bunch of Core services. Instead, we can just brute force this.
Proposed resolution
Use vfsStream to test this. Its why we added the library to core!
Remaining tasks
Review
User interface changes
Nada
API changes
Nil
Comment | File | Size | Author |
---|---|---|---|
#3 | use_vfs_for_filestorage-2453399-3.patch | 10.54 KB | neclimdul |
#3 | use_vfs_for_filestorage-2453399-3.interdiff.txt | 7.94 KB | neclimdul |
Comments
Comment #1
neclimdulWoops, I wrote some of this last night and apparently it was too late. Better documentation and such.
Comment #2
dawehnerAs said on IRC we should better use sha256 here.
Comment #3
neclimdulDone. Touched up some tests too. Microtime because if the first loop fails it'd take until the next second before we actually got a different result out of hash().
Comment #4
dawehnerI like it!
Comment #5
alexpottI like it too. I've fought will this before and solved the threaded thing but this is better. This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 98b74d2 and pushed to 8.0.x. Thanks!