Skip to content

Commit

Permalink
Merge pull request #2118 from opentensor/junius/fix-e2e-test-hanging
Browse files Browse the repository at this point in the history
Fix e2e test hanging
  • Loading branch information
open-junius authored Jul 11, 2024
2 parents e4e7249 + 2040e13 commit 4af08f0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/e2e_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,22 @@ def local_chain(request):
)

# Pattern match indicates node is compiled and ready
pattern = re.compile(r"Successfully ran block step\.")
pattern = re.compile(r"Imported #1")

# install neuron templates
logging.info("downloading and installing neuron templates from github")
templates_dir = clone_or_update_templates()
install_templates(templates_dir)

timestamp = int(time.time())

def wait_for_node_start(process, pattern):
for line in process.stdout:
print(line.strip())
# 10 min as timeout
if int(time.time()) - timestamp > 10 * 60:
print("Subtensor not started in time")
break
if pattern.search(line):
print("Node started!")
break
Expand Down

0 comments on commit 4af08f0

Please sign in to comment.