@@ -1358,7 +1358,9 @@ mod tests {
1358
1358
assert_eq ! ( entries_second. len( ) , 12 ) ;
1359
1359
assert_eq ! ( entries, entries_second. into_iter( ) . collect:: <Vec <_>>( ) ) ;
1360
1360
1361
- test_lru_cache_like_behaviour ( & mut store, myspace. id ( ) )
1361
+ test_lru_cache_like_behaviour ( & mut store, myspace. id ( ) ) ?;
1362
+ store. flush ( ) ?;
1363
+ Ok ( ( ) )
1362
1364
}
1363
1365
1364
1366
/// Test that [`Store::register_useful_peer`] behaves like a LRUCache of size
@@ -1585,7 +1587,7 @@ mod tests {
1585
1587
. get_exact ( namespace. id ( ) , author. id ( ) , key, false ) ?
1586
1588
. unwrap ( ) ;
1587
1589
assert_eq ! ( res, entry) ;
1588
-
1590
+ store . flush ( ) ? ;
1589
1591
Ok ( ( ) )
1590
1592
}
1591
1593
@@ -1637,7 +1639,8 @@ mod tests {
1637
1639
check_entries ( & mut alice_store, & myspace. id ( ) , & author, & bob_set) ?;
1638
1640
check_entries ( & mut bob_store, & myspace. id ( ) , & author, & alice_set) ?;
1639
1641
check_entries ( & mut bob_store, & myspace. id ( ) , & author, & bob_set) ?;
1640
-
1642
+ alice_store. flush ( ) ?;
1643
+ bob_store. flush ( ) ?;
1641
1644
Ok ( ( ) )
1642
1645
}
1643
1646
@@ -1700,7 +1703,8 @@ mod tests {
1700
1703
get_content_hash( & mut alice_store, namespace. id( ) , author. id( ) , key) ?,
1701
1704
Some ( alice_hash_2)
1702
1705
) ;
1703
-
1706
+ alice_store. flush ( ) ?;
1707
+ bob_store. flush ( ) ?;
1704
1708
Ok ( ( ) )
1705
1709
}
1706
1710
@@ -1758,7 +1762,7 @@ mod tests {
1758
1762
get_entry( & mut store, namespace. id( ) , author. id( ) , key) ?,
1759
1763
entry2
1760
1764
) ;
1761
-
1765
+ store . flush ( ) ? ;
1762
1766
Ok ( ( ) )
1763
1767
}
1764
1768
@@ -1772,6 +1776,7 @@ mod tests {
1772
1776
let hash = Hash :: new ( b"" ) ;
1773
1777
let res = replica. insert ( b"foo" , & alice, hash, 0 ) ;
1774
1778
assert ! ( matches!( res, Err ( InsertError :: EntryIsEmpty ) ) ) ;
1779
+ store. flush ( ) ?;
1775
1780
Ok ( ( ) )
1776
1781
}
1777
1782
@@ -1824,7 +1829,7 @@ mod tests {
1824
1829
store. get_exact( myspace. id( ) , alice. id( ) , b"foo" , false ) ?,
1825
1830
None
1826
1831
) ;
1827
-
1832
+ store . flush ( ) ? ;
1828
1833
Ok ( ( ) )
1829
1834
}
1830
1835
@@ -1876,7 +1881,8 @@ mod tests {
1876
1881
sync ( & mut alice, & mut bob) ?;
1877
1882
check_entries ( & mut alice_store, & myspace. id ( ) , & author, & [ "fog" , "fooz" ] ) ?;
1878
1883
check_entries ( & mut bob_store, & myspace. id ( ) , & author, & [ "fog" , "fooz" ] ) ?;
1879
-
1884
+ alice_store. flush ( ) ?;
1885
+ bob_store. flush ( ) ?;
1880
1886
Ok ( ( ) )
1881
1887
}
1882
1888
@@ -1928,6 +1934,7 @@ mod tests {
1928
1934
. get_many ( namespace. id ( ) , Query :: all ( ) ) ?
1929
1935
. collect :: < Vec < _ > > ( ) ;
1930
1936
assert_eq ! ( res. len( ) , 1 ) ;
1937
+ store. flush ( ) ?;
1931
1938
Ok ( ( ) )
1932
1939
}
1933
1940
@@ -1994,6 +2001,7 @@ mod tests {
1994
2001
namespace. id ( ) ,
1995
2002
vec ! [ vec![ 1u8 , 0u8 ] , vec![ 1u8 , 2u8 ] ] ,
1996
2003
) ;
2004
+ store. flush ( ) ?;
1997
2005
Ok ( ( ) )
1998
2006
}
1999
2007
@@ -2033,7 +2041,7 @@ mod tests {
2033
2041
let mut latest_keys: Vec < Vec < u8 > > = latest. iter ( ) . map ( |r| r. 2 . to_vec ( ) ) . collect ( ) ;
2034
2042
latest_keys. sort ( ) ;
2035
2043
assert_eq ! ( latest_keys, vec![ b"a0.2" . to_vec( ) , b"a1.1" . to_vec( ) ] ) ;
2036
-
2044
+ store . flush ( ) ? ;
2037
2045
Ok ( ( ) )
2038
2046
}
2039
2047
@@ -2083,6 +2091,7 @@ mod tests {
2083
2091
namespace. id ( ) ,
2084
2092
vec ! [ vec![ 1u8 , 0u8 ] , vec![ 1u8 , 2u8 ] , vec![ 0u8 , 255u8 ] ] ,
2085
2093
) ;
2094
+ store. flush ( ) ?;
2086
2095
Ok ( ( ) )
2087
2096
}
2088
2097
@@ -2130,6 +2139,7 @@ mod tests {
2130
2139
let mut replica = store. open_replica ( & namespace. id ( ) ) ?;
2131
2140
let res = replica. hash_and_insert ( b"foo" , & author, b"bar" ) ;
2132
2141
assert ! ( res. is_ok( ) ) ;
2142
+ store. flush ( ) ?;
2133
2143
Ok ( ( ) )
2134
2144
}
2135
2145
@@ -2246,7 +2256,8 @@ mod tests {
2246
2256
assert_eq ! ( state1. num_recv, 0 ) ;
2247
2257
assert_eq ! ( state2. num_sent, 0 ) ;
2248
2258
assert_eq ! ( state2. num_recv, 1 ) ;
2249
-
2259
+ store1. flush ( ) ?;
2260
+ store2. flush ( ) ?;
2250
2261
Ok ( ( ) )
2251
2262
}
2252
2263
@@ -2436,7 +2447,7 @@ mod tests {
2436
2447
( "hi" , & a3) ,
2437
2448
] ,
2438
2449
) ;
2439
-
2450
+ store . flush ( ) ? ;
2440
2451
Ok ( ( ) )
2441
2452
}
2442
2453
@@ -2470,6 +2481,7 @@ mod tests {
2470
2481
store. set_download_policy ( & id, policy. clone ( ) ) ?;
2471
2482
let retrieved_policy = store. get_download_policy ( & id) ?;
2472
2483
assert_eq ! ( retrieved_policy, policy) ;
2484
+ store. flush ( ) ?;
2473
2485
Ok ( ( ) )
2474
2486
}
2475
2487
0 commit comments