File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed 
tests/integration_tests/functional Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -207,12 +207,20 @@ def test_deflate_on_oom(uvm_plain_any, deflate_on_oom):
207207    balloon_size_before  =  test_microvm .api .balloon_stats .get ().json ()["actual_mib" ]
208208    make_guest_dirty_memory (test_microvm .ssh , 128 )
209209
210-     balloon_size_after  =  test_microvm .api .balloon_stats .get ().json ()["actual_mib" ]
211-     print (f"size before: { balloon_size_before }   size after: { balloon_size_after }  " )
212-     if  deflate_on_oom :
213-         assert  balloon_size_after  <  balloon_size_before , "Balloon did not deflate" 
210+     try :
211+         balloon_size_after  =  test_microvm .api .balloon_stats .get ().json ()["actual_mib" ]
212+     except  ConnectionError :
213+         assert  (
214+             not  deflate_on_oom 
215+         ), "Guest died even though it should have deflated balloon to alleviate memory pressure" 
216+ 
217+         test_microvm .mark_killed ()
214218    else :
215-         assert  balloon_size_after  >=  balloon_size_before , "Balloon deflated" 
219+         print (f"size before: { balloon_size_before }   size after: { balloon_size_after }  " )
220+         if  deflate_on_oom :
221+             assert  balloon_size_after  <  balloon_size_before , "Balloon did not deflate" 
222+         else :
223+             assert  balloon_size_after  >=  balloon_size_before , "Balloon deflated" 
216224
217225
218226# pylint: disable=C0103 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments