Page MenuHomePhabricator

GlobalTest::testReadOnlySet() fails due to feature in GlobalFunctions::wfReadOnly()
Closed, ResolvedPublic

Description

Author: nashtrash1

Description:
Feature in function GlobalFunctions::wfReadOnly(), commented, "Set $wgReadOnly
for faster access next time" causes test GlobalTest::testReadOnlySet() to fail.

  1. $wgReadOnly starts as null
  2. GlobalTest::testReadOnlyEmpty() calls wfReadOnly(). Since $wgReadOnly is

null, $wgReadOnlyFile is read, and, assuming it's empty, $wgReadOnly is set to
"false"

  1. GlobalTest::testReadOnlySet() modifies the file described by $wgReadOnlyFile

and calls wfReadOnly(), which does not open the file again but instead returns
the value of $wgReadOnly ("false").


Version: 1.6.x
Severity: normal
Platform: PC

Details

Reference
bz6522

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:16 PM
bzimport set Reference to bz6522.
bzimport added a subscriber: Unknown Object (MLST).

nashtrash1 wrote:

patch for GlobalTest.php

patch for GlobalTest.php that resets $wgReadOnly to null before each call to
wfReadOnly(), which forces wfReadOnly() to read "read only" status from file.

Attached:

robchur wrote:

This *should* have been fixed in r22801...

Going to consider this fixed per comment 2.