daandemeyer / rpms / systemd

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