@@ -45,22 +45,29 @@ def get_rss_from_pmap():
4545
4646def make_guest_dirty_memory (ssh_connection , should_oom = False , amount = 8192 ):
4747 """Tell the guest, over ssh, to dirty `amount` pages of memory."""
48+ logger = logging .getLogger ("make_guest_dirty_memory" )
49+
4850 amount_in_mbytes = amount / MB_TO_PAGES
4951
50- exit_code , _ , _ = ssh_connection .execute_command (
51- "/sbin/fillmem {}" .format (amount_in_mbytes )
52- )
52+ cmd = f"/sbin/fillmem { amount_in_mbytes } "
53+ exit_code , stdout , stderr = ssh_connection .execute_command (cmd )
54+ # add something to the logs for troubleshooting
55+ if exit_code != 0 :
56+ logger .error ("while running: %s" , cmd )
57+ logger .error ("stdout: %s" , stdout .read ())
58+ logger .error ("stderr: %s" , stderr .read ())
5359
5460 cmd = "cat /tmp/fillmem_output.txt"
5561 _ , stdout , _ = ssh_connection .execute_command (cmd )
5662 if should_oom :
5763 assert (
58- exit_code == 0
59- and ("OOM Killer stopped the program with " "signal 9, exit code 0" )
60- in stdout .read ()
64+ "OOM Killer stopped the program with "
65+ "signal 9, exit code 0" in stdout .read ()
6166 )
6267 else :
63- assert exit_code == 0 and ("Memory filling was " "successful" ) in stdout .read ()
68+ assert exit_code == 0 , stderr .read ()
69+ stdout_txt = stdout .read ()
70+ assert "Memory filling was successful" in stdout_txt , stdout_txt
6471
6572
6673def build_test_matrix (network_config , bin_cloner_path , logger ):
0 commit comments