File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -42,11 +42,24 @@ fn download() {
42
42
// TODO: test the with_json code path
43
43
} ;
44
44
45
+ let persist_downloads_count = || {
46
+ app. as_inner ( )
47
+ . downloads_counter
48
+ . persist_all_shards ( app. as_inner ( ) )
49
+ . expect ( "failed to persist downloads count" ) ;
50
+ } ;
51
+
45
52
download ( "foo_download/1.0.0" ) ;
53
+ // No downloads are counted until the counters are persisted
54
+ assert_dl_count ( "foo_download/1.0.0" , None , 0 ) ;
55
+ assert_dl_count ( "foo_download" , None , 0 ) ;
56
+ persist_downloads_count ( ) ;
57
+ // Now that the counters are persisted the download counts show up.
46
58
assert_dl_count ( "foo_download/1.0.0" , None , 1 ) ;
47
59
assert_dl_count ( "foo_download" , None , 1 ) ;
48
60
49
61
download ( "FOO_DOWNLOAD/1.0.0" ) ;
62
+ persist_downloads_count ( ) ;
50
63
assert_dl_count ( "FOO_DOWNLOAD/1.0.0" , None , 2 ) ;
51
64
assert_dl_count ( "FOO_DOWNLOAD" , None , 2 ) ;
52
65
You can’t perform that action at this time.
0 commit comments