From 562503c231951787b758938ac553750978b25f1e Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 11 Nov 2021 12:22:19 -0800 Subject: [PATCH] try that --- selfdrive/test/test_onroad.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/selfdrive/test/test_onroad.py b/selfdrive/test/test_onroad.py index 3fd93cd6fd53bd..c117a3d986c087 100755 --- a/selfdrive/test/test_onroad.py +++ b/selfdrive/test/test_onroad.py @@ -97,7 +97,8 @@ def cputime_total(ct): def check_cpu_usage(first_proc, last_proc): - result = "------------------------------------------------\n" + result = "\n" + result += "------------------------------------------------\n" result += "------------------ CPU Usage -------------------\n" result += "------------------------------------------------\n" @@ -212,6 +213,7 @@ def test_model_execution_timings(self): self.assertLess(np.mean(ts), avg_max, f"high avg '{s}' execution time: {np.mean(ts)}") result += f"'{s}' execution time: {min(ts)}\n" result += f"'{s}' avg execution time: {np.mean(ts)}\n" + result += "------------------------------------------------\n" print(result) def test_timings(self): @@ -232,15 +234,15 @@ def test_timings(self): np.testing.assert_allclose(np.mean(ts), dt, rtol=0.03, err_msg=f"{s} - failed mean timing check") np.testing.assert_allclose([np.max(ts), np.min(ts)], dt, rtol=maxmin, err_msg=f"{s} - failed max/min timing check") except Exception as e: - result += str(e) + result += str(e) + "\n" passed = False if np.std(ts) / dt > rsd: - result += f"{s} - failed RSD timing check" + result += f"{s} - failed RSD timing check\n" passed = False - result += f"{s}: {np.array([np.mean(ts), np.max(ts), np.min(ts)])*1e3}" - result += f" {np.max(np.absolute([np.max(ts)/dt, np.min(ts)/dt]))} {np.std(ts)/dt}" + result += f"{s}: {np.array([np.mean(ts), np.max(ts), np.min(ts)])*1e3}\n" + result += f" {np.max(np.absolute([np.max(ts)/dt, np.min(ts)/dt]))} {np.std(ts)/dt}\n" result += "="*67 print(result) self.assertTrue(passed)