Close eth node after usage (#1741)

This commit is contained in:
andri lim 2023-09-08 21:37:50 +07:00 committed by GitHub
parent cf9553196e
commit 348a9aea6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -153,8 +153,12 @@ proc newEngineEnv*(conf: var NimbusConf, chainFile: string, enableAuth: bool): E
sync : sync sync : sync
) )
proc close(node: EthereumNode) =
node.stopListening()
waitFor node.listeningServer.closeWait()
proc close*(env: EngineEnv) = proc close*(env: EngineEnv) =
env.node.stopListening() env.node.close()
env.sync.stop() env.sync.stop()
waitFor env.client.close() waitFor env.client.close()
waitFor env.sealer.stop() waitFor env.sealer.stop()

View File

@ -256,7 +256,7 @@ let wdTestList* = [
"- Wait for sync, which include syncing a pre-Withdrawals block, and verify withdrawn account's balance\n", "- Wait for sync, which include syncing a pre-Withdrawals block, and verify withdrawn account's balance\n",
run: specExecute[SyncSpec], run: specExecute[SyncSpec],
spec: SyncSpec( spec: SyncSpec(
timeoutSeconds: 300, timeoutSeconds: 50,
wdForkHeight: 2, wdForkHeight: 2,
wdBlockCount: 128, wdBlockCount: 128,
wdPerBlock: MAINNET_MAX_WITHDRAWAL_COUNT_PER_BLOCK, wdPerBlock: MAINNET_MAX_WITHDRAWAL_COUNT_PER_BLOCK,