anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

Blame SOURCES/0429-tests-sleep-a-bit-and-give-kernel-time-to-perform-th.patch

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