See if adding a sleep + retry makes test less flaky on CI

This commit is contained in:
Kovid Goyal 2020-12-06 13:09:53 +05:30
parent 1056534a71
commit c8b70c30b9
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -5,7 +5,7 @@
__license__ = 'GPL v3'
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
import zlib, json, os
import zlib, json, os, time
from io import BytesIO
from functools import partial
@ -36,6 +36,10 @@ class ContentTest(LibraryBaseTest):
conn = server.connect()
request = partial(make_request, conn, prefix='/ajax/book')
try:
r, data = request('/x')
except ConnectionRefusedError:
time.sleep(2)
r, data = request('/x')
self.ae(r.status, NOT_FOUND)