mirror of
https://github.com/btcsuite/btcd.git
synced 2026-08-13 12:32:51 +02:00
Two pieces of rpctest's global state silently aliased across concurrent test processes (which is what `go test ./...` does by default, so any `make unit` that exercises -tags=rpctest hit this): - btcdExecutablePath compiled to a fixed path /tmp/btcd/rpctest/btcd. Two `go build` invocations would race on the same file, occasionally yielding a truncated or stale binary and downstream "tls: certificate signed by unknown authority" failures when the harness tried to talk to the resulting node. - lastPort started at the same defaultNodePort in every process. The bind-test in NextAvailablePort closes the listener before returning, so two processes climbing from the same base would frequently hand out the same port and one harness would die with "connection refused" when btcd failed to bind. Suffix the executable with a random uint32 and seed lastPort with a random offset into a 50k-port window so each process climbs through its own range. |
||
|---|---|---|
| .. | ||
| rpctest | ||
| bip0009_test.go | ||
| chain_test.go | ||
| csv_fork_test.go | ||
| getchaintips_test.go | ||
| invalidate_reconsider_block_test.go | ||
| log.go | ||
| main.go | ||
| p2a_test.go | ||
| prune_test.go | ||
| rawtx_test.go | ||
| README.md | ||
| reorg_test.go | ||
| rpcserver_test.go | ||
| sync_race_test.go | ||