This repository was archived by the owner on Nov 6, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -624,19 +624,29 @@ mod tests {
624624
625625 // unknown - node 6
626626
627+ // nodes are also ordered according to their addition time
628+ //
629+ // nanosecond precision lost since mac os x high sierra update so let's not compare their order
630+ // https://github.com/paritytech/parity-ethereum/issues/9632
627631 let r = table. nodes ( & IpFilter :: default ( ) ) ;
628632
629- assert_eq ! ( r[ 0 ] [ ..] , id4[ ..] ) ; // most recent success
630- assert_eq ! ( r[ 1 ] [ ..] , id3[ ..] ) ;
633+ // most recent success
634+ assert ! (
635+ ( r[ 0 ] == id4 && r[ 1 ] == id3) ||
636+ ( r[ 0 ] == id3 && r[ 1 ] == id4)
637+ ) ;
631638
632639 // unknown (old contacts and new nodes), randomly shuffled
633640 assert ! (
634- r[ 2 ] [ .. ] == id5[ .. ] && r[ 3 ] [ .. ] == id6[ .. ] ||
635- r[ 2 ] [ .. ] == id6[ .. ] && r[ 3 ] [ .. ] == id5[ .. ]
641+ ( r[ 2 ] == id5 && r[ 3 ] == id6) ||
642+ ( r[ 2 ] == id6 && r[ 3 ] == id5)
636643 ) ;
637644
638- assert_eq ! ( r[ 4 ] [ ..] , id1[ ..] ) ; // oldest failure
639- assert_eq ! ( r[ 5 ] [ ..] , id2[ ..] ) ;
645+ // oldest failure
646+ assert ! (
647+ ( r[ 4 ] == id1 && r[ 5 ] == id2) ||
648+ ( r[ 4 ] == id2 && r[ 5 ] == id1)
649+ ) ;
640650 }
641651
642652 #[ test]
You can’t perform that action at this time.
0 commit comments