RSS: Fix nondeterministic test failures

Caused by 'rss announce add' triggering headline announces, that would
delay the execution of the 'remove' commands.

Thanks to @mapreri and @Unit193 for help in reproducing the issue
and confirming the patch.
This commit is contained in:
Valentin Lorentz 2021-08-22 19:23:05 +02:00
parent 0c8e455b4e
commit ca624d7ae6

View File

@ -103,9 +103,14 @@ class RSSTestCase(ChannelPluginTestCase):
@mock_urllib @mock_urllib
def testRemoveAliasedFeed(self, mock): def testRemoveAliasedFeed(self, mock):
mock._data = xkcd_new mock._data = xkcd_old
try: try:
self.assertNotError('rss announce add http://xkcd.com/rss.xml') self.assertNotError('rss announce add http://xkcd.com/rss.xml')
# Clear the queue or it's going to mess up the finally block
self.assertRegexp(' ', 'Snake Facts')
self.assertNoResponse(' ')
self.assertNotError('rss add xkcd http://xkcd.com/rss.xml') self.assertNotError('rss add xkcd http://xkcd.com/rss.xml')
finally: finally:
self.assertNotError('rss announce remove http://xkcd.com/rss.xml') self.assertNotError('rss announce remove http://xkcd.com/rss.xml')