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 {
624
624
625
625
// unknown - node 6
626
626
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
627
631
let r = table. nodes ( & IpFilter :: default ( ) ) ;
628
632
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
+ ) ;
631
638
632
639
// unknown (old contacts and new nodes), randomly shuffled
633
640
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)
636
643
) ;
637
644
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
+ ) ;
640
650
}
641
651
642
652
#[ test]
You can’t perform that action at this time.
0 commit comments