selftests: net: prevent Python from buffering the output
Make sure Python doesn't buffer the output, otherwise for some tests we may see false positive timeouts in NIPA. NIPA thinks that a machine has hung if the test doesn't print anything for 3min. This is also nice to heave for running the tests manually, especially in vng. Reviewed-by: Petr Machata <petrm@nvidia.com> Link: https://patch.msgid.link/20250716205712.1787325-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -32,6 +32,7 @@ class KsftTerminate(KeyboardInterrupt):
|
|||||||
|
|
||||||
|
|
||||||
def ksft_pr(*objs, **kwargs):
|
def ksft_pr(*objs, **kwargs):
|
||||||
|
kwargs["flush"] = True
|
||||||
print("#", *objs, **kwargs)
|
print("#", *objs, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
@@ -139,7 +140,7 @@ def ktap_result(ok, cnt=1, case="", comment=""):
|
|||||||
res += "." + str(case.__name__)
|
res += "." + str(case.__name__)
|
||||||
if comment:
|
if comment:
|
||||||
res += " # " + comment
|
res += " # " + comment
|
||||||
print(res)
|
print(res, flush=True)
|
||||||
|
|
||||||
|
|
||||||
def ksft_flush_defer():
|
def ksft_flush_defer():
|
||||||
@@ -227,8 +228,8 @@ def ksft_run(cases=None, globs=None, case_pfx=None, args=()):
|
|||||||
|
|
||||||
totals = {"pass": 0, "fail": 0, "skip": 0, "xfail": 0}
|
totals = {"pass": 0, "fail": 0, "skip": 0, "xfail": 0}
|
||||||
|
|
||||||
print("TAP version 13")
|
print("TAP version 13", flush=True)
|
||||||
print("1.." + str(len(cases)))
|
print("1.." + str(len(cases)), flush=True)
|
||||||
|
|
||||||
global KSFT_RESULT
|
global KSFT_RESULT
|
||||||
cnt = 0
|
cnt = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user