Skip to content

Commit

Permalink
Debug Hibernate: Try with sync
Browse files Browse the repository at this point in the history
  • Loading branch information
adityagesh committed Nov 25, 2024
1 parent 99b1b20 commit a303fe0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion microsoft/testsuites/power/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ def verify_hibernation(

# only set up hibernation setup tool for the first time
hibernation_setup_tool.start()
# This is a temporary workaround for a bug observed in Redhat Distros
# where the VM is not able to hibernate immediately after installing
# the hibernation-setup tool.
# A sleep(100) also works, but we are unsure of the exact time required.
# So it is safer to reboot the VM.
node.execute("sync", sudo=True)
# if isinstance(node.os, Redhat):
# node.reboot()

boot_time_before_hibernation = node.execute(
"echo \"$(last reboot -F | head -n 1 | awk '{print $5, $6, $7, $8, $9}')\"",
Expand All @@ -82,7 +90,6 @@ def verify_hibernation(
).stdout

hibfile_offset = hibernation_setup_tool.get_hibernate_resume_offset_from_hibfile()
time.sleep(100)
try:
startstop.stop(state=features.StopState.Hibernate)
except Exception as ex:
Expand Down

0 comments on commit a303fe0

Please sign in to comment.