mirror of
https://github.com/status-im/nim-codex.git
synced 2025-02-07 16:33:53 +00:00
fix testblockexpiration failing occassionally
This was due to a port clash, and the codex nodes would not start.
This commit is contained in:
parent
971dadda46
commit
ed48f50367
@ -1,5 +1,6 @@
|
||||
import std/os
|
||||
import std/httpclient
|
||||
import std/strformat
|
||||
import std/strutils
|
||||
from std/net import TimeoutError
|
||||
|
||||
@ -8,6 +9,9 @@ import ../ethertest
|
||||
import ./codexprocess
|
||||
import ./nodeprocess
|
||||
|
||||
const CodexApiPort {.intdefine.}: int = 8080
|
||||
const CodexDiscPort {.intdefine.}: int = 8090
|
||||
|
||||
ethersuite "Node block expiration tests":
|
||||
var node: CodexProcess
|
||||
var baseurl: string
|
||||
@ -16,7 +20,7 @@ ethersuite "Node block expiration tests":
|
||||
let content = "test file content"
|
||||
|
||||
setup:
|
||||
baseurl = "http://localhost:8080/api/codex/v1"
|
||||
baseurl = &"http://localhost:{CodexApiPort}/api/codex/v1"
|
||||
|
||||
teardown:
|
||||
await node.stop()
|
||||
@ -26,11 +30,11 @@ ethersuite "Node block expiration tests":
|
||||
proc startTestNode(blockTtlSeconds: int) {.async.} =
|
||||
node = await CodexProcess.startNode(
|
||||
@[
|
||||
"--api-port=8080",
|
||||
&"--api-port={CodexApiPort}",
|
||||
"--data-dir=" & dataDir,
|
||||
"--nat=none",
|
||||
"--listen-addrs=/ip4/127.0.0.1/tcp/0",
|
||||
"--disc-port=8090",
|
||||
&"--disc-port={CodexDiscPort}",
|
||||
"--block-ttl=" & $blockTtlSeconds,
|
||||
"--block-mi=1",
|
||||
"--block-mn=10",
|
||||
|
Loading…
x
Reference in New Issue
Block a user