Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #5525 from taokayan/testscript
Browse files Browse the repository at this point in the history
4904 add hint if launcher fails, more reliable port available check
  • Loading branch information
heifner authored Sep 4, 2018
2 parents 71d4b83 + 9cf65f7 commit 0135a2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion programs/eosio-launcher/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ launcher_def::initialize (const variables_map &vmap) {

stage = bfs::path(erd);
if (!bfs::exists(stage)) {
cerr << erd << " is not a valid path" << endl;
cerr << "\"" << erd << "\" is not a valid path. Please ensure environment variable EOSIO_HOME is set to the build path." << endl;
exit (-1);
}
stage /= bfs::path("staging");
Expand Down
12 changes: 8 additions & 4 deletions tests/Cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,13 @@ def launch(self, pnodes=1, totalNodes=1, prodCount=1, topo="mesh", p2pPlugin="ne
assert(isinstance(totalProducers, (str,int)))
producerFlag="--producers %s" % (totalProducers)

if not Cluster.arePortsAvailable(set(range(self.port, self.port+totalNodes+1))):
Utils.Print("ERROR: Another process is listening on nodeos default port.")
return False
tries = 30
while not Cluster.arePortsAvailable(set(range(self.port, self.port+totalNodes+1))):
Utils.Print("ERROR: Another process is listening on nodeos default port. wait...")
if tries == 0:
return False
tries = tries - 1
time.sleep(2)

cmd="%s -p %s -n %s -s %s -d %s -i %s -f --p2p-plugin %s %s" % (
Utils.EosLauncherPath, pnodes, totalNodes, topo, delay, datetime.datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3],
Expand All @@ -147,7 +151,7 @@ def launch(self, pnodes=1, totalNodes=1, prodCount=1, topo="mesh", p2pPlugin="ne
s=" ".join(cmdArr)
if Utils.Debug: Utils.Print("cmd: %s" % (s))
if 0 != subprocess.call(cmdArr):
Utils.Print("ERROR: Launcher failed to launch.")
Utils.Print("ERROR: Launcher failed to launch. failed cmd: %s" % (s))
return False

self.nodes=list(range(totalNodes)) # placeholder for cleanup purposes only
Expand Down

0 comments on commit 0135a2f

Please sign in to comment.