? ? Pending

User tests: Successful: Unsuccessful:

avatar csthomas
csthomas
5 Feb 2017

Summary of Changes

Fix unit test in cache tests.
Change file cache handler methods get and store to work on Windows system too.

On Windows system flock works different. It locks other methods from read/write on the same file in the same process.

Example:

$f = fopen('filename.txt', 'rb');
flock($f, LOCK_EX|LOCK_NB);
$content = stream_get_contents($f);
$content2 = file_get_contents('filename.txt'); // <- on Windows it will fail, but on linux it works

See http://php.net/manual/en/function.flock.php

flock() uses mandatory locking instead of advisory locking on Windows.

Testing Instructions

Code review
or standard test to check whether joomla create cache files.

Cache should works as before on linux system.
On windows it start to work after patch applied.

Expected result

App veyor success with cache tests

Actual result

App veyor failed with cache tests

Documentation Changes Required

No

avatar csthomas csthomas - open - 5 Feb 2017
avatar csthomas csthomas - change - 5 Feb 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 5 Feb 2017
Category Libraries
avatar csthomas csthomas - change - 5 Feb 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 6 Feb 2017
Category Libraries Libraries Unit Tests
avatar csthomas csthomas - change - 6 Feb 2017
Labels Added: ?
avatar csthomas csthomas - change - 6 Feb 2017
The description was changed
avatar csthomas csthomas - edited - 6 Feb 2017
avatar csthomas csthomas - change - 6 Feb 2017
Title
Attempt to fix cache error on appveyor
[AppVeyor] Unit tests fix for file cache
avatar csthomas csthomas - edited - 6 Feb 2017
avatar csthomas csthomas - change - 6 Feb 2017
The description was changed
avatar csthomas csthomas - edited - 6 Feb 2017
avatar csthomas csthomas - change - 7 Feb 2017
The description was changed
avatar csthomas csthomas - edited - 7 Feb 2017
avatar csthomas
csthomas - comment - 7 Feb 2017

@mbabker Can you take a look?

avatar csthomas csthomas - change - 8 Feb 2017
The description was changed
avatar csthomas csthomas - edited - 8 Feb 2017
avatar wilsonge wilsonge - change - 8 Feb 2017
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-02-08 09:34:50
Closed_By wilsonge
avatar wilsonge wilsonge - close - 8 Feb 2017
avatar wilsonge wilsonge - merge - 8 Feb 2017
avatar wilsonge
wilsonge - comment - 8 Feb 2017

I'm going to merge this on review as it fixes unit tests

Add a Comment

Login with GitHub to post a comment