mirror of
https://github.com/status-im/nim-codex.git
synced 2025-02-08 00:44: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/os
|
||||||
import std/httpclient
|
import std/httpclient
|
||||||
|
import std/strformat
|
||||||
import std/strutils
|
import std/strutils
|
||||||
from std/net import TimeoutError
|
from std/net import TimeoutError
|
||||||
|
|
||||||
@ -8,6 +9,9 @@ import ../ethertest
|
|||||||
import ./codexprocess
|
import ./codexprocess
|
||||||
import ./nodeprocess
|
import ./nodeprocess
|
||||||
|
|
||||||
|
const CodexApiPort {.intdefine.}: int = 8080
|
||||||
|
const CodexDiscPort {.intdefine.}: int = 8090
|
||||||
|
|
||||||
ethersuite "Node block expiration tests":
|
ethersuite "Node block expiration tests":
|
||||||
var node: CodexProcess
|
var node: CodexProcess
|
||||||
var baseurl: string
|
var baseurl: string
|
||||||
@ -16,7 +20,7 @@ ethersuite "Node block expiration tests":
|
|||||||
let content = "test file content"
|
let content = "test file content"
|
||||||
|
|
||||||
setup:
|
setup:
|
||||||
baseurl = "http://localhost:8080/api/codex/v1"
|
baseurl = &"http://localhost:{CodexApiPort}/api/codex/v1"
|
||||||
|
|
||||||
teardown:
|
teardown:
|
||||||
await node.stop()
|
await node.stop()
|
||||||
@ -26,11 +30,11 @@ ethersuite "Node block expiration tests":
|
|||||||
proc startTestNode(blockTtlSeconds: int) {.async.} =
|
proc startTestNode(blockTtlSeconds: int) {.async.} =
|
||||||
node = await CodexProcess.startNode(
|
node = await CodexProcess.startNode(
|
||||||
@[
|
@[
|
||||||
"--api-port=8080",
|
&"--api-port={CodexApiPort}",
|
||||||
"--data-dir=" & dataDir,
|
"--data-dir=" & dataDir,
|
||||||
"--nat=none",
|
"--nat=none",
|
||||||
"--listen-addrs=/ip4/127.0.0.1/tcp/0",
|
"--listen-addrs=/ip4/127.0.0.1/tcp/0",
|
||||||
"--disc-port=8090",
|
&"--disc-port={CodexDiscPort}",
|
||||||
"--block-ttl=" & $blockTtlSeconds,
|
"--block-ttl=" & $blockTtlSeconds,
|
||||||
"--block-mi=1",
|
"--block-mi=1",
|
||||||
"--block-mn=10",
|
"--block-mn=10",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user