Page MenuHomePhabricator

wfResetOutputBuffers() breaks unit tests
Closed, ResolvedPublic

Description

If something being unit tested calls wfResetOutputBuffers(), it will remove the output handler that PHPUnit uses to catch output to detect tests producing output when they shouldn't be.

In the old version of PHPUnit used by Jenkins, this manifests as a warning "ob_end_clean(): failed to delete buffer. No buffer to delete" causing the test to fail. In more modern versions of PHPUnit, the missing buffer is detected and the test is instead marked as "risky".

Of course, it breaking depends on wfResetOutputBuffers actually working in the first place (see T109842 and HHVM bug 4868).

Event Timeline

Anomie claimed this task.
Anomie raised the priority of this task from to Needs Triage.
Anomie updated the task description. (Show Details)
Anomie added a project: MediaWiki-Core-Tests.
Anomie subscribed.

Change 232951 had a related patch set uploaded (by Anomie):
Fix so wfResetOutputBuffers doesn't break unit tests

https://gerrit.wikimedia.org/r/232951

Change 232951 merged by jenkins-bot:
Fix so wfResetOutputBuffers doesn't break unit tests

https://gerrit.wikimedia.org/r/232951