• Matthew Slipper's avatar
    op-e2e: Reduce flakiness in p2p tests (#9333) · dcdf044f
    Matthew Slipper authored
    P2P tests were flaking sometimes due to the checks asserting that everything received was published. `require.ElementsMatch` requires that lists be equal, sans duplicates. Sometimes, however, messages would get sent multiple times/not be picked up in time for the assertions leading to errors like this following:
    
    ```
    listA:
    ([]string) (len=29) {
     ... elided
     (string) (len=68) "0xd770621d3b0a196087ace7efcb0a8a61b353736526f6095946c714ec134b1648:1",
     (string) (len=69) "0x71a364bf88d4e7e049cfe1635e95c31c9d93435b03a4d20c8863637fc0eb319f:28",
     (string) (len=68) "0xd770621d3b0a196087ace7efcb0a8a61b353736526f6095946c714ec134b1648:1"
    }
    
    listB:
    ([]string) (len=29) {
     (string) (len=68) "0xd770621d3b0a196087ace7efcb0a8a61b353736526f6095946c714ec134b1648:1",
     ... elided
     (string) (len=69) "0xf84acde28fb7b630f9e5d91bddc7c2d4d2e1f4ce29a7d1a4551fee9ac828b10f:29"
    }
    
    extra elements in list A:
    ([]interface {}) (len=1) {
     (string) (len=68) "0xd770621d3b0a196087ace7efcb0a8a61b353736526f6095946c714ec134b1648:1"
    }
    
    extra elements in list B:
    ([]interface {}) (len=1) {
     (string) (len=69) "0xf84acde28fb7b630f9e5d91bddc7c2d4d2e1f4ce29a7d1a4551fee9ac828b10f:29"
    }
    ```
    
    This PR refactors to use `require.Subset` which handles this case while still asserting that everything received was in fact published.
    dcdf044f
Name
Last commit
Last update
..
actions Loading commit data...
config Loading commit data...
e2eutils Loading commit data...
external Loading commit data...
external_geth Loading commit data...
faultproofs Loading commit data...
.gitignore Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
bridge_test.go Loading commit data...
build_helper.go Loading commit data...
deposit_test.go Loading commit data...
eip4844_test.go Loading commit data...
external.go Loading commit data...
helper.go Loading commit data...
l1_beacon_client_test.go Loading commit data...
l2_gossip_test.go Loading commit data...
op_geth.go Loading commit data...
op_geth_test.go Loading commit data...
sequencer_failover_setup.go Loading commit data...
sequencer_failover_test.go Loading commit data...
setup.go Loading commit data...
system_adminrpc_test.go Loading commit data...
system_fpp_test.go Loading commit data...
system_test.go Loading commit data...
system_tob_test.go Loading commit data...
tracer.go Loading commit data...
tx_helper.go Loading commit data...
withdrawal_helper.go Loading commit data...