set test log level to trace

This commit is contained in:
Eric Mastro 2023-04-20 19:21:22 +10:00 committed by benbierens
parent 78fa4dd3a3
commit d0cdfae075
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
3 changed files with 9 additions and 7 deletions

View File

@ -15,11 +15,11 @@ template multinodesuite*(name: string,
startNodes: StartNodes, debugNodes: DebugNodes, body: untyped) = startNodes: StartNodes, debugNodes: DebugNodes, body: untyped) =
if (debugNodes.client or debugNodes.provider) and if (debugNodes.client or debugNodes.provider) and
(enabledLogLevel > LogLevel.DEBUG or (enabledLogLevel > LogLevel.TRACE or
enabledLogLevel == LogLevel.NONE): enabledLogLevel == LogLevel.NONE):
echo "" echo ""
echo "More test debug logging is available by running the tests with " & echo "More test debug logging is available by running the tests with " &
"'-d:chronicles_log_level=DEBUG " & "'-d:chronicles_log_level=TRACE " &
"-d:chronicles_default_output_device=stdout " & "-d:chronicles_default_output_device=stdout " &
"-d:chronicles_sinks=textlines'" "-d:chronicles_sinks=textlines'"
echo "" echo ""
@ -46,7 +46,7 @@ template multinodesuite*(name: string,
"--disc-port=" & $(8090 + index), "--disc-port=" & $(8090 + index),
"--eth-account=" & $accounts[index]] "--eth-account=" & $accounts[index]]
.concat(addlOptions) .concat(addlOptions)
if debug: options.add "--log-level=INFO;DEBUG: " & debugNodes.topics if debug: options.add "--log-level=INFO;TRACE: " & debugNodes.topics
let node = startNode(options, debug = debug) let node = startNode(options, debug = debug)
(node, datadir, accounts[index]) (node, datadir, accounts[index])

View File

@ -51,7 +51,7 @@ proc init*(_: type StartNodes,
proc init*(_: type DebugNodes, proc init*(_: type DebugNodes,
client, provider, validator: bool, client, provider, validator: bool,
topics: string = "validation,proving"): DebugNodes = topics: string = "validator,proving"): DebugNodes =
DebugNodes(client: client, provider: provider, validator: validator, DebugNodes(client: client, provider: provider, validator: validator,
topics: topics) topics: topics)

View File

@ -126,9 +126,6 @@ multinodesuite "Simulate invalid proofs",
let config = await marketplace.config() let config = await marketplace.config()
period = config.proofs.period.truncate(uint64) period = config.proofs.period.truncate(uint64)
periodDowntime = config.proofs.downtime periodDowntime = config.proofs.downtime
await provider.getSigner(accounts[0]).mint()
await provider.getSigner(accounts[2]).mint()
await provider.getSigner(accounts[2]).deposit()
proofSubmitted = newFuture[void]("proofSubmitted") proofSubmitted = newFuture[void]("proofSubmitted")
proc onProofSubmitted(event: ProofSubmitted) = proc onProofSubmitted(event: ProofSubmitted) =
submitted.add(event.proof) submitted.add(event.proof)
@ -140,6 +137,11 @@ multinodesuite "Simulate invalid proofs",
downtime = @[] downtime = @[]
periodicity = Periodicity(seconds: period.u256) periodicity = Periodicity(seconds: period.u256)
# Our Hardhat configuration does use automine, which means that time tracked by `provider.currentTime()` is not
# advanced until blocks are mined and that happens only when transaction is submitted.
# As we use in tests provider.currentTime() which uses block timestamp this can lead to synchronization issues.
await provider.advanceTime(1.u256)
teardown: teardown:
await subscription.unsubscribe() await subscription.unsubscribe()