tests: sleep a bit and give kernel time to perform the action after manual freeze/thaw

Fixes: #16050
This commit is contained in:
Michal Sekletár 2020-06-05 11:35:01 +02:00
parent 0ce8092109
commit a0d79df8e5
1 changed files with 4 additions and 0 deletions

View File

@ -246,6 +246,8 @@ test_preserve_state() {
echo -n " - freeze from outside: "
echo 1 > /sys/fs/cgroup/"${slice}"/cgroup.freeze
# Give kernel some time to freeze the slice
sleep 1
# Our state should not be affected
check_freezer_state "${slice}" "running"
@ -258,6 +260,8 @@ test_preserve_state() {
echo -n " - thaw from outside: "
echo 0 > /sys/fs/cgroup/"${slice}"/cgroup.freeze
sleep 1
check_freezer_state "${unit}" "running"
check_freezer_state "${slice}" "running"
grep -q "frozen 0" /sys/fs/cgroup/"${slice}"/cgroup.events