Page MenuHomePhabricator

unsigned comments cause travis build breakage
Closed, ResolvedPublic

Description

When a section ends with an unsigned comment, on one of Xqt's talk pages, the archivebot tests fail

https://travis-ci.org/wikimedia/pywikibot-core/jobs/29181593


Version: core-(2.0)
Severity: normal

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:26 AM
bzimport set Reference to bz67663.
bzimport added a subscriber: Unknown Object (????).

Previously the error was

======================================================================
FAIL: test_wikipedia_de (tests.archivebot_tests.TestArchiveBot)
Test archivebot for one site
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/wikimedia/pywikibot-core/tests/archivebot_tests.py", line 63, in test_archivebot
    self.assertTrue(isinstance(thread.timestamp, datetime))
AssertionError: False is not true

that line of test code has changed slightly, and the error is now:

======================================================================
FAIL: test_archivebot_de (tests.archivebot_tests.TestArchiveBot)
Test archivebot for one site on wikipedia:de
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/wikimedia/pywikibot-core/tests/aspects.py", line 243, in wrapped_method
    func(self, key)
  File "/home/travis/build/wikimedia/pywikibot-core/tests/archivebot_tests.py", line 68, in test_archivebot
    self.assertIsInstance(thread.timestamp, datetime)
AssertionError: None is not an instance of <type 'datetime.datetime'>

https://travis-ci.org/wikimedia/pywikibot-core/jobs/35365726

Change 160513 had a related patch set uploaded by John Vandenberg:
Remove test dependency on sigs on de:user_talk:xqt

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

Change 160513 merged by jenkins-bot:
Remove test dependency on sigs on de:user_talk:xqt

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

We have a partial workaround only

jayvdb set Security to None.
jayvdb removed a subscriber: Unknown Object (????).

In such cases, I think that the most reasonable explanation is that the format for the date has been changed overtime, so trying to apply the 20114 settings to a 2010 page might be the root cause of this kind of problems.

>>> import pywikibot
>>> site = pywikibot.Site('frr', 'wikipedia')
>>> site.months_names
[(u'Januar', u'Jan.'), (u'Februar', u'Feb.'), (u'Marts', u'Mar.'), (u'April', u'Apr.'), (u'Moi', u'Moi'), (u'Juuni', u'Jun.'), (u'Juuli', u'Jul.'), (u'August', u'Aug.'), (u'Sept\xe4mber', u'Sep.'), (u'Oktoober', u'Okt.'), (u'Now\xe4mber', u'Now.'), (u'Dets\xe4mber', u'Det.')]

Capital A in Aug
Unfortunately, I have no idea on a possible workaround.
The only wild thing I can think of, is to have a bot running on tools which scans the known families for a change and raises a flag, but then what ...?

The Aug message hasnt changed since 2010; why did the test fail now?

https://translatewiki.net/w/i.php?title=MediaWiki:Aug/frr&action=history
https://frr.wikipedia.org/w/index.php?title=MediaWiki:Aug&action=history

could we do case insensitive matching to reduce the problem?

Insensitive matching might be an option.

But do you mean it is still failing today?
What I meant is that in 2010, august was 'aug.' in signatures, now it is 'Aug.', so somewhere between 2010 and now, the date format for signatures has changed.

The test on frr.wp for many months but only broke this week?

Sorry, I do not follow you. The link you posted was changed in 2014, why are you pointing at this change now?
tests/archivebot_tests.py do not fail for me on 'frr'.

another example of this problem, or our config for frr is wrong:
https://frr.wikipedia.org/w/index.php?title=Benutzer_Diskussion:Xqt&diff=107105&oldid=78749

(thanks XZise)

@Mpaa: just a editorial note but using > you can quote someone, or click on the arrow pointing down and selecting “Quote”:

Hello World

Sorry, I do not follow you. The link you posted was changed in 2014, why are you pointing at this change now?
tests/archivebot_tests.py do not fail for me on 'frr'.

another example of this problem, or our config for frr is wrong:
https://frr.wikipedia.org/w/index.php?title=Benutzer_Diskussion:Xqt&diff=107105&oldid=78749

(thanks XZise)

Sorry I forgot to mention the test failure on travis, which occurred on the same day.
https://travis-ci.org/wikimedia/pywikibot-core/jobs/67201252#L2777

Can we add some debug output, in case it will happen again? I cannot reproduce it.

$ python tests/archivebot_tests.py
tests: max_retries reduced from 25 to 1
.x.........................x.........x.......
Ran 45 tests in 141.523s

OK (expected failures=3)

Something like:

try:
    self.assertIsInstance(thread.content, basestring)
except AssertionError as e:
    pywikibot.output('code %s: %s' % (thread.code, thread.content))
    raise(e)

Yea I couldnt reproduce either. That debug addition looks good.

Change 220553 had a related patch set uploaded (by Mpaa):
arcivebot_tests.py: denug statement for failing travis builds

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

Something like:

try:
    self.assertIsInstance(thread.content, basestring)
except AssertionError as e:
    pywikibot.output('code %s: %s' % (thread.code, thread.content))
    raise(e)

I meant:

self.assertIsInstance(thread.timestamp, datetime)

Change 220553 merged by XZise:
archivebot_tests.py: debug statement for failing travis builds

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

I've checked Travis logs for builds in our semi-official github repository for last 7 months (up to build #3458 and haven't found any occurance of AssertionError: False is not true nor AssertionError: None is not an instance of <type 'datetime.datetime'> so it looks, that it is not failing right now.

I'm moving it to T152961.

This is happening again:

tests/archivebot_tests.py::TestArchiveBot::test_archivebot_frr <- tests/aspects.py code frr: -> [[:de:Benutzer_Diskussion:Xqt]]

:Ich habe diese Seite durchaus auch unter Beobachtung ;) &nbsp;<small>[[Benutzer Diskussion:Xqt|@]]</small>[[Benutzer:Xqt|xqt]] 12:43, 20. Now. 2011 (CET)

::Danke für Deine Rückmeldung!

::Ich hatte in den letzten Tagen zahlreiche ähnliche Links auf Benutzerseiten gesetzt, weil viele Bots und User ihre frr-Userseiten leider nicht auf ihrer Beo haben. Falls Du frr-Fragen lieber auf dieser Seite beantworten möchtest, dann lösch den Link (oben) doch bitte wieder. Bitte entschuldige meine Übereifrigkeit. --[[Benutzer:Murma174|Murma174]] 12:56, 20. Now. 2011 (CET)

FAILED

https://travis-ci.org/wikimedia/pywikibot-core/jobs/186160609#L876

Xqt claimed this task.

unsigned comments are valid threads and archivebot ignores them. Unfortunately these threads leads test to fail but we must not ignore them otherwise we cannot check whether the regexes work properly. How proceed in this case?

  • either add a timestamp to the talk thread
  • or use an alternate talk page for a given site

All other exceptions means there is an undetected timestamp and should be fixed be the regex.

This comment was removed by Xqt.
Xqt removed Xqt as the assignee of this task.
In T69663#4425035, @Xqt wrote:

unsigned comments are valid threads and archivebot ignores them. Unfortunately these threads leads test to fail but we must not ignore them otherwise we cannot check whether the regexes work properly. How proceed in this case?

  • either add a timestamp to the talk thread
  • or use an alternate talk page for a given site

All other exceptions means there is an undetected timestamp and should be fixed be the regex.

T182685

Change 483655 had a related patch set uploaded (by Dvorapa; owner: Dvorapa):
[pywikibot/core@master] [IMPR] Archive unsigned threads using timestamp of the next thread

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

Not actively working on it

Change 483655 had a related patch set uploaded (by Dvorapa; owner: Dvorapa):
[pywikibot/core@master] [IMPR] Archive unsigned threads using timestamp of the next thread

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

Change 820477 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [IMPR] Archive unsigned threads using timestamp of the next thread

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

Change 483655 abandoned by Xqt:

[pywikibot/core@master] [IMPR] Archive unsigned threads using timestamp of the next thread

Reason:

outdated

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

Xqt claimed this task.

Change 820477 merged by jenkins-bot:

[pywikibot/core@master] [IMPR] Archive unsigned threads using timestamp of the next thread

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