server: TestRetriesDuringSwap fails
This failure is coming from the same pipeline as the one reported in https://github.com/decred/dcrdex/issues/2228, but since these are independent tests (seemingly sharing no global state) I'll just call it a coincidence until proven otherwise.
2023-03-05 08:15:18.136 [INF] TEST: Loaded swap data for 0 active swaps.
2023-03-05 08:15:18.137 [DBG] TEST: Swapper started with 1s broadcast timeout and 200ms tx wait expiration.
2023-03-05 08:15:18.139 [DBG] TEST: Negotiate: sending 'match' ack request to user 224cbaaafa80bf3bd1ff731590bcbdda5a76f91e60a156994634e91c00000030 for 1 matches
2023-03-05 08:15:18.139 [DBG] TEST: Negotiate: sending 'match' ack request to user 224cbaaafa80bf3bd1ff731590bcbdda5a76f91e60a156994634e91c00000031 for 1 matches
2023-03-05 08:15:18.139 [DBG] TEST: processMatchAcks: 'match' ack received from 224cbaaafa80bf3bd1ff731590bcbdda5a76f91e60a156994634e91c00000030 for 1 matches
2023-03-05 08:15:18.139 [DBG] TEST: processMatchAcks: storing valid 'match' ack signature from 224cbaaafa80bf3bd1ff731590bcbdda5a76f91e60a156994634e91c00000030 (maker=true) for match f184c07e29ff1dd05f4302848bd686d76bf95f1f21ca1d7898437f088bd8bd74 (status NewlyMatched)
2023-03-05 08:15:18.139 [DBG] TEST: processMatchAcks: 'match' ack received from 224cbaaafa80bf3bd1ff731590bcbdda5a76f91e60a156994634e91c00000031 for 1 matches
2023-03-05 08:15:18.139 [DBG] TEST: processMatchAcks: storing valid 'match' ack signature from 224cbaaafa80bf3bd1ff731590bcbdda5a76f91e60a156994634e91c00000031 (maker=false) for match f184c07e29ff1dd05f4302848bd686d76bf95f1f21ca1d7898437f088bd8bd74 (status NewlyMatched)
2023-03-05 08:15:18.139 [DBG] TEST: handleInit: 'init' received from user 224cbaaafa80bf3bd1ff731590bcbdda5a76f91e60a156994634e91c00000030 for match f184c07e29ff1dd05f4302848bd686d76bf95f1f21ca1d7898437f088bd8bd74, order a16003e755aeea0774335ffd61c0a40271d9964546e73c6a47816b3e6d9728b0
2023-03-05 08:15:18.139 [DBG] TEST: Allowing until 2023-03-05 08:15:18.339935599 +0000 UTC (199.9993ms) to locate contract from maker (NewlyMatched), match f184c07e29ff1dd05f4302848bd686d76bf95f1f21ca1d7898437f088bd8bd74, tx (qwe)
2023-03-05 08:15:18.140 [DBG] TEST: Error going to user 224cbaaafa80bf3bd1ff731590bcbdda5a76f91e60a156994634e91c00000030, code: 25, msg: incorrect recipient. expected 492. got 49
2023-03-05 08:15:18.387 [TRC] TEST: checkInactionEventBased: match f184c07e29ff1dd05f4302848bd686d76bf95f1f21ca1d7898437f088bd8bd74 (NewlyMatched)
2023-03-05 08:15:18.637 [TRC] TEST: checkInactionEventBased: match f184c07e29ff1dd05f4302848bd686d76bf95f1f21ca1d7898437f088bd8bd74 (NewlyMatched)
2023-03-05 08:15:18.888 [TRC] TEST: checkInactionEventBased: match f184c07e29ff1dd05f4302848bd686d76bf95f1f21ca1d7898437f088bd8bd74 (NewlyMatched)
2023-03-05 08:15:19.137 [TRC] TEST: checkInactionBlockBased: asset 789, match f184c07e29ff1dd05f4302848bd686d76bf95f1f21ca1d7898437f088bd8bd74 (NewlyMatched)
2023-03-05 08:15:19.137 [TRC] TEST: checkInactionEventBased: match f184c07e29ff1dd05f4302848bd686d76bf95f1f21ca1d7898437f088bd8bd74 (NewlyMatched)
2023-03-05 08:15:19.137 [DBG] TEST: failMatch: swap f184c07e29ff1dd05f4302848bd686d76bf95f1f21ca1d7898437f088bd8bd74 failing at NewlyMatched (no swap as maker), user fault = true
2023-03-05 08:15:19.137 [INF] TEST: Sending a 'revoke_match' notification to each client for match f184c07e29ff1dd05f4302848bd686d76bf95f1f21ca1d7898437f088bd8bd74
--- FAIL: TestRetriesDuringSwap (1.00s)
swap_test.go:2068: ensure swap status: server received our swap -> counterparty got audit request timed out
will try to investigate and resolve while I've got context.
seemingly sharing no global state
Ah, well, I think this is exactly the reason, the state being shared is tRecipientSpoofer: https://github.com/decred/dcrdex/blob/4efb73d35bcc59d3c40af8679ff8a41cae90b625/server/swap/swap_test.go#L2011-L2015
that's ^ in TestMalformedSwap and the https://github.com/decred/dcrdex/issues/2228 failure happened exactly at swap_test.go:2013 right after adding that extra "2" to SwapAddress which renders swap recipient in TestRetriesDuringSwap invalid (which is why it ultimately fails here, according to that log snippet in ticket description).
Do you think it's worth trying to refactor away those globals in swap_test.go ? I can give it a try. Or we can just close the issue and move on, keeping this gotcha in mind.