naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
c2dfb7
From 9028873ee3bffe37b50fa7ada123fcf270de4658 Mon Sep 17 00:00:00 2001
c2dfb7
From: =?UTF-8?q?Michal=20Sekleta=CC=81r?= <msekleta@redhat.com>
c2dfb7
Date: Fri, 5 Jun 2020 11:35:01 +0200
c2dfb7
Subject: [PATCH] tests: sleep a bit and give kernel time to perform the action
c2dfb7
 after manual freeze/thaw
c2dfb7
c2dfb7
Fixes: #16050
c2dfb7
(cherry picked from commit a0d79df8e59c6bb6dc0382d71e835dec869a7df4)
c2dfb7
c2dfb7
Related: #1848421
c2dfb7
---
c2dfb7
 test/TEST-38-FREEZER/testsuite.sh | 4 ++++
c2dfb7
 1 file changed, 4 insertions(+)
c2dfb7
c2dfb7
diff --git a/test/TEST-38-FREEZER/testsuite.sh b/test/TEST-38-FREEZER/testsuite.sh
c2dfb7
index 6fcadb8f8e..18b7bd6dce 100755
c2dfb7
--- a/test/TEST-38-FREEZER/testsuite.sh
c2dfb7
+++ b/test/TEST-38-FREEZER/testsuite.sh
c2dfb7
@@ -246,6 +246,8 @@ test_preserve_state() {
c2dfb7
 
c2dfb7
     echo -n "  - freeze from outside: "
c2dfb7
     echo 1 > /sys/fs/cgroup/"${slice}"/cgroup.freeze
c2dfb7
+    # Give kernel some time to freeze the slice
c2dfb7
+    sleep 1
c2dfb7
 
c2dfb7
     # Our state should not be affected
c2dfb7
     check_freezer_state "${slice}" "running"
c2dfb7
@@ -258,6 +260,8 @@ test_preserve_state() {
c2dfb7
 
c2dfb7
     echo -n "  - thaw from outside: "
c2dfb7
     echo 0 > /sys/fs/cgroup/"${slice}"/cgroup.freeze
c2dfb7
+    sleep 1
c2dfb7
+
c2dfb7
     check_freezer_state "${unit}" "running"
c2dfb7
     check_freezer_state "${slice}" "running"
c2dfb7
     grep -q "frozen 0" /sys/fs/cgroup/"${slice}"/cgroup.events