Page MenuHomePhabricator

Running page_tests.py causes python to crash
Closed, DeclinedPublic

Description

Running tests/page_tests.py under windows causes python.exe to crash. Suspect it is due to having mwparserfromhell installed, but not being able to use the mwparserfromhell.parser.use_c which I manually have to set to false to ensure that python doesn't crash, will investigate and provide followup


Version: core-(2.0)
Severity: normal

Details

Reference
bz66330

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:25 AM
bzimport set Reference to bz66330.
bzimport added a subscriber: Unknown Object (????).

Change 138209 had a related patch set uploaded by Gerrit Patch Uploader:
fix pep8 error in the categoryFormat() and add check for mwparserfromhell usage on windows, and set parser.use_c = False if you can load mwpfh on windows. See bug 66330

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

Change 138210 had a related patch set uploaded by Gerrit Patch Uploader:
fix pep8 error in the categoryFormat() and add check for mwparserfromhell usage on windows, and set parser.use_c = False if you can load mwpfh on windows. See bug 66330

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

Change 138211 had a related patch set uploaded by Gerrit Patch Uploader:
fix pep8 error in the categoryFormat() and add check for mwparserfromhell usage on windows, and set parser.use_c = False if you can load mwpfh on windows. See bug 66330

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

Change 138211 abandoned by John Vandenberg:
fix pep8 error in the categoryFormat() and add check for mwparserfromhell usage on windows, and set parser.use_c = False if you can load mwpfh on windows. See bug 66330

Reason:
Dup of Id1bafc078f924a4cc52bfe165b9639af9d4145d

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

Do all test case in tests/page_tests.py fail? Can you attach a log of the unit test?

In the gerrit code review https://gerrit.wikimedia.org/r/#/c/138209/, it was explained that the issue upstream was closed without resolution:
https://github.com/earwig/mwparserfromhell/issues/54

C:\rewrite>pwb.py tests\page_tests.py --v
testHashCmp (main__.TestLinkObject) ... ok
testNamespaces (
main.TestLinkObject)
Test that Link() normalizes namespace names ... ok
testTitles (
main.TestLinkObject)
Test that Link() normalizes titles ... ok
testApiMethods (
main__.TestPageObject)
Test various methods that rely on API. ...

is all I get

I am running on windows environment without mwpfh installed. It's result is:

c:\Pywikipedia\ssh\pywikibot\core>pwb.py tests/page_tests -v
testHashCmp (main__.TestLinkObject) ... ok
testNamespaces (
main.TestLinkObject)
Test that Link() normalizes namespace names ... ok
testTitles (
main.TestLinkObject)
Test that Link() normalizes titles ... ok
testApiMethods (
main.TestPageObject)
Test various methods that rely on API. ... ok
testGeneral (
main.TestPageObject) ... ok
testIsCategory (
main.TestPageObject)
Test isCategory method. ... ok
testIsDisambig (
main.TestPageObject) ... ok
testIsImage (
main.TestPageObject) ... ok
testIsRedirect (
main.TestPageObject) ... ok
testIsTalkPage (
main.TestPageObject)
Test isTalkPage() method. ... ok
testLinks (
main.TestPageObject) ... ok
testNamespace (
main.TestPageObject)
Test namespace() method ... ok
testPageGet (
main.TestPageObject) ... ok
testReferences (
main.TestPageObject) ... ok
testSection (
main.TestPageObject)
Test section() method. ... ok
testSite (
main.TestPageObject)
Test site() method ... ok
testTitle (
main__.TestPageObject)
Test title() method options. ... ok


Ran 17 tests in 2.806s

OK

c:\Pywikipedia\ssh\pywikibot\core>

After cleaning the api-cache I got the same exept it needs some more time:

Ran 17 tests in 32.706s

OK

I have installed mwparserfromhell using pip, resulting in 0.3.3, and mwparserfromhell.parser.use_c being True by default.

When I run textlib_tests and page_tests, they run correctly on a 32bit system.

I suspect that there was a problem with the mwparserfromhell build, either upstream or a local build issue.

Recommend reinstalling again via pip, to be sure.

If the problem still exists, run the tests with full debug/verbose logging as shown in https://gerrit.wikimedia.org/r/#/c/146046/ , then remove the password from the log and upload it as an attachment to bugzilla, re-open the bug, and specify whether you have 64bit or 32bit machine.

Change 138210 abandoned by John Vandenberg:
fix pep8 error in the categoryFormat() and add check for mwparserfromhell usage on windows, and set parser.use_c = False if you can load mwpfh on windows. See bug 66330

Reason:
Cant reproduce the problem, and if there is still a problem it needs to be fixed in mwparserfromhell.

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