Skip to content

Commit

Permalink
increase test timeout for Visdom server
Browse files Browse the repository at this point in the history
  • Loading branch information
piskvorky committed Jul 27, 2020
1 parent 161ad55 commit 05282f5
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions gensim/test/test_lda_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,17 @@ def setUp(self):
self.port = 8097

def testCallbackUpdateGraph(self):

# Popen have no context-manager in 2.7, for this reason - try/finally.
try:
# spawn visdom.server
proc = subprocess.Popen(['python', '-m', 'visdom.server', '-port', str(self.port)])

with subprocess.Popen(['python', '-m', 'visdom.server', '-port', str(self.port)]) as proc:
# wait for visdom server startup (any better way?)
time.sleep(3)

viz = Visdom(server=self.host, port=self.port)
for attempt in range(5):
time.sleep(1.0) # seconds
if viz.check_connection():
break
assert viz.check_connection()

# clear screen
viz.close()

self.model.update(self.corpus)
finally:
proc.kill()
self.model.update(self.corpus)


if __name__ == '__main__':
Expand Down

0 comments on commit 05282f5

Please sign in to comment.