Skip to content

Commit aa2c3f2

Browse files
authored
tests: repeat cmd when all RMIDs are on limbo list
1 parent b4dc8ca commit aa2c3f2

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

tests/testcases/test.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import os
3434
import logging
3535
import subprocess
36+
import time
3637
import psutil
3738
from testlib.env import Env
3839

@@ -73,9 +74,17 @@ def fini(self):
7374

7475
## Runs command and adds output to log
7576
def run(self, command, quiet=False):
76-
with subprocess.Popen(command.split(), stdin=subprocess.PIPE, stdout=subprocess.PIPE,
77-
stderr=subprocess.PIPE, encoding="utf-8") as child:
78-
stdout, stderr = child.communicate()
77+
with subprocess.Popen(command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE,
78+
encoding="utf-8") as child:
79+
(stdout, stderr) = child.communicate()
80+
81+
# repeat command on RMID exhaustion
82+
if "Failed to create resctrl group /sys/fs/resctrl/COS" in stdout:
83+
# wait for limbo list cleanup
84+
time.sleep(1)
85+
with subprocess.Popen(command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE,
86+
encoding="utf-8") as child:
87+
(stdout, stderr) = child.communicate()
7988

8089
if not quiet:
8190
self.log.debug(command)

0 commit comments

Comments
 (0)