File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
kube-runtime/src/reflector Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,7 @@ where
152152#[ cfg( test) ]
153153pub ( crate ) mod test {
154154 use crate :: {
155+ reflector:: ObjectRef ,
155156 watcher:: { Error , Event } ,
156157 WatchStreamExt ,
157158 } ;
@@ -239,7 +240,7 @@ pub(crate) mod test {
239240 let foo = Arc :: new ( foo) ;
240241 let _bar = Arc :: new ( bar) ;
241242
242- let ( _ , writer) = reflector:: store_shared ( 10 ) ;
243+ let ( reader , writer) = reflector:: store_shared ( 10 ) ;
243244 let mut subscriber = pin ! ( writer. subscribe( ) . unwrap( ) ) ;
244245 let mut other_subscriber = pin ! ( writer. subscribe( ) . unwrap( ) ) ;
245246 let mut reflect = pin ! ( st. reflect_shared( writer) ) ;
@@ -249,8 +250,11 @@ pub(crate) mod test {
249250 poll!( reflect. next( ) ) ,
250251 Poll :: Ready ( Some ( Ok ( Event :: Delete ( _) ) ) )
251252 ) ) ;
253+ assert_eq ! ( reader. get( & ObjectRef :: from_obj( & foo) ) , Some ( foo. clone( ) ) ) ;
252254 assert_eq ! ( poll!( subscriber. next( ) ) , Poll :: Ready ( Some ( foo. clone( ) ) ) ) ;
255+ assert_eq ! ( reader. get( & ObjectRef :: from_obj( & foo) ) , Some ( foo. clone( ) ) ) ;
253256 assert_eq ! ( poll!( other_subscriber. next( ) ) , Poll :: Ready ( Some ( foo. clone( ) ) ) ) ;
257+ assert_eq ! ( reader. get( & ObjectRef :: from_obj( & foo) ) , None ) ;
254258
255259 assert ! ( matches!(
256260 poll!( reflect. next( ) ) ,
Original file line number Diff line number Diff line change @@ -258,7 +258,7 @@ where
258258 key. extra . remaining_lookups = Some ( lookups - 1 ) ;
259259 store. insert ( key, obj. clone ( ) ) ;
260260 }
261- } ;
261+ }
262262
263263 obj
264264 } )
You can’t perform that action at this time.
0 commit comments