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 31d2b87
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions gensim/test/test_lda_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,16 @@ 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()


Expand Down

0 comments on commit 31d2b87

Please sign in to comment.