test: bifrost suites wait for what they assert, cheaper key and random fixtures

🔎 Visual review of ecc4c2b0 (same diff as 54efe860): explainer, review flags and prompts to ask an AI about the change

Fifteen test-speed changes from the RSI loop: tests wait for what they assert instead of sleeping fixed times, and slow fixtures (key generation, argon2 armor, crypto/rand per character) get cheaper. No test is deleted, skipped or weakened: the batch judge requires every base-passing test to pass, and kills every mutant the base kills in common and x/thorchain. Production behavior is unchanged. The non-test edits are test seams whose defaults are the old values, plus one equivalent key-export path.

Commits

  • test(blockscanner): scanner suite waits on progress, not whole seconds (L3-0068): blockscanner wall 31.8s → 18.7s (−41.2%).
  • test(blockscanner): stalled-scanner helper stops on 50 unmoved fetches (L3-0069): 18.6s → 14.5s (−22.1%).
  • test(blockscanner): extra-suite scan-loop tests poll for what they assert (L3-0070): 14.4s → 7.8s (−45.6%).
  • test(observer): mock streams with a finished remote return EOF at once (L3-0072): observer 74.5s → 64.7s (−13.1%).
  • test(telemetry): seed ETH addresses from random bytes, not fresh keys (L3-0076): 37.6s → 26.5s (−29.6%).
  • test(common): RandHexString reads its randomness in one call (L3-0077): one crypto/rand read and rejection sampling keep each character uniform over the same alphabet. It is called only from test fixtures. 26.6s → 24.5s (−7.6%).
  • test(p2p): party coordinator test joins on a 3s timeout, not 10s (L3-0081): 41.0s → 29.1s (−29.1%).
  • test(signer): keysign batch window is a package var; signer tests use 10ms (L3-0086): signer 22.5s → 13.7s (−39.0%).
  • test(signer): TestProcess waits for both loops' second pass, not 2s (L3-0087): 13.8s → 12.5s (−9.1%).
  • test(signer): retained XMR keygen rechecks every 10ms in the handoff test (L3-0088): xmrKeygenRecheckInterval defaults to ThorchainBlockTime, as before. 12.6s → 11.6s (−7.7%).
  • test(thorclient): take private keys straight from the keyring, not via argon2 armor (L3-0094): ExportPrivKeyArmor encrypts with the same password that unarmoring then decrypts with, so the round trip is the identity. The key comes from ExportPrivateKeyObject when the keyring has it, and the old path is the fallback. utxo + thorclient 18.9s → 9.4s (−50.0%).
  • test(oracle): provider tests wait for the prices they assert, not fixed sleeps (L3-0097): 17.2s → 2.8s (−83.7%).
  • test(oracle): zero the websocket subscribe pause in provider tests (L3-0098): wsSubscribeDelay defaults to 100ms, as before. 2.9s → 2.5s (−13.6%).
  • test(utxo): rpc retry tests record their backoffs instead of sleeping them (L3-0101): retrySleep defaults to time.Sleep. 15.9s → 2.0s (−87.4%).
  • test(tss): KeySign suite batches keysigns over 10ms instead of 1s (L3-0105): KeySignBatchInterval defaults to 1s, as before. 18.3s → 9.2s (−49.8%).

Batch verdict

testspeed over the 10 touched packages, 5 alternating runs per side: wall median 87.9s → 75.9s (−13.64%, p=0.004, n=5). Same tests pass on both sides, and the mutation guard on common and x/thorchain lost no kills. Consensus-safety review: the only consensus-directory change is common/random_string.go, which only test fixtures reach (x/thorchain/types/test_common.go).

RSI ideas: L3-0068, L3-0069, L3-0070, L3-0072, L3-0076, L3-0077, L3-0081, L3-0086, L3-0087, L3-0088, L3-0094, L3-0097, L3-0098, L3-0101, L3-0105

🤖 Generated with Claude Code


Published by huginn from the RSI loop (lane L3, ideas: L3-0068, L3-0069, L3-0070, L3-0072, L3-0076, L3-0077, L3-0081, L3-0086, L3-0087, L3-0088, L3-0094, L3-0097, L3-0098, L3-0101, L3-0105). The batch was judged as a whole by the loop's frozen judges, so huginn makes no code changes to it; it only rebases it (without AI) and merges it.

Edited by Huginn Ai

Merge request reports

Loading
Loading