File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -612,6 +612,47 @@ mod tests {
612
612
state. drain ( ) . await ;
613
613
}
614
614
615
+ #[ tokio:: test]
616
+ async fn del_workload_before_snapshot_removes_from_pending ( ) {
617
+ let fixture = fixture ! ( ) ;
618
+ let mut state = fixture. state ;
619
+
620
+ let ns = new_netns ( ) ;
621
+
622
+ // to make the proxy fail, bind to its ports in its netns
623
+ let _sock = create_proxy_conflict ( & ns) ;
624
+
625
+ let data = WorkloadData {
626
+ netns : ns,
627
+ workload_uid : uid ( 0 ) ,
628
+ workload_info : workload_info ( ) ,
629
+ } ;
630
+
631
+ let ret = state
632
+ . process_msg ( WorkloadMessage :: AddWorkload ( data) )
633
+ . await ;
634
+
635
+ assert ! ( state. snapshot_names. len( ) == 1 ) ;
636
+ assert ! ( ret. is_err( ) ) ;
637
+ assert ! ( state. have_pending( ) ) ;
638
+
639
+ state
640
+ . process_msg ( WorkloadMessage :: DelWorkload ( uid ( 0 ) ) )
641
+ . await
642
+ . unwrap ( ) ;
643
+
644
+ assert ! ( state. snapshot_names. is_empty( ) ) ;
645
+
646
+ state
647
+ . process_msg ( WorkloadMessage :: WorkloadSnapshotSent )
648
+ . await
649
+ . unwrap ( ) ;
650
+
651
+ assert ! ( state. snapshot_names. is_empty( ) ) ;
652
+ assert ! ( !state. have_pending( ) ) ;
653
+ state. drain ( ) . await ;
654
+ }
655
+
615
656
#[ tokio:: test]
616
657
async fn add_delete_add_workload_starts_only_one_proxy ( ) {
617
658
let fixture = fixture ! ( ) ;
You can’t perform that action at this time.
0 commit comments