Skip to content

Commit

Permalink
test(fix): term ganache
Browse files Browse the repository at this point in the history
  • Loading branch information
rymnc committed Aug 16, 2023
1 parent 2d2c46a commit b30929a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/waku_rln_relay/test_rln_group_manager_onchain.nim
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ proc runGanache(): Process =
debug "Ganache daemon is running and ready", pid=ganachePID, startLog=ganacheStartLog
return runGanache
except: # TODO: Fix "BareExcept" warning
error "Ganache daemon run failed"
error "Ganache daemon run failed", err = getCurrentExceptionMsg()


# Stops Ganache daemon
Expand All @@ -148,12 +148,12 @@ proc stopGanache(runGanache: Process) {.used.} =
# We wait the daemon to exit
try:
# We terminate Ganache daemon by sending a SIGTERM signal to the runGanache PID to trigger RPC server termination and clean-up
terminate(runGanache)
discard startProcess("pkill", args = ["-f", "ganache"], options = {poUsePath})
# NOTE: the below line must remain commented out, otherwise it will cause a deadlocked state
# ref: https://nim-lang.org/docs/osproc.html#waitForExit%2CProcess%2Cint
# debug "ganache logs", logs=runGanache.outputstream.readAll()
debug "Sent SIGTERM to Ganache", ganachePID=ganachePID
except CatchableError:
except:
error "Ganache daemon termination failed: ", err = getCurrentExceptionMsg()

proc setup(signer = true): Future[OnchainGroupManager] {.async.} =
Expand Down

0 comments on commit b30929a

Please sign in to comment.