@ -254,7 +254,7 @@ class TestFwFingerprintTiming(unittest.TestCase):
@pytest . mark . timeout ( 60 )
def test_fw_query_timing ( self ) :
total_ref_time = 6.8
total_ref_time = { 1 : 5.55 , 2 : 6.05 }
brand_ref_times = {
1 : {
' gm ' : 0.5 ,
@ -276,24 +276,27 @@ class TestFwFingerprintTiming(unittest.TestCase):
}
}
total_time = 0
total_times = { 1 : 0.0 , 2 : 0.0 }
for num_pandas in ( 1 , 2 ) :
for brand , config in FW_QUERY_CONFIGS . items ( ) :
with self . subTest ( brand = brand , num_pandas = num_pandas ) :
multi_panda_requests = [ r for r in config . requests if r . bus > 3 ]
if not len ( multi_panda_requests ) and num_pandas > 1 :
raise unittest . SkipTest ( " No multi-panda FW queries " )
avg_time = self . _benchmark_brand ( brand , num_pandas )
total_time + = avg_time
total_times [ num_pandas ] + = avg_time
avg_time = round ( avg_time , 2 )
self . _assert_timing ( avg_time , brand_ref_times [ num_pandas ] [ brand ] )
ref_time = brand_ref_times [ num_pandas ] . get ( brand )
if ref_time is None :
# ref time should be same as 1 panda if no aux queries
ref_time = brand_ref_times [ num_pandas - 1 ] [ brand ]
self . _assert_timing ( avg_time , ref_time )
print ( f ' { brand =} , { num_pandas =} , { len ( config . requests ) =} , avg FW query time= { avg_time } seconds ' )
with self . subTest ( brand = ' all_brands ' ) :
total_time = round ( total_time , 2 )
self . _assert_timing ( total_time , total_ref_time )
print ( f ' all brands, total FW query time= { total_time } seconds ' )
for num_pandas in ( 1 , 2 ) :
with self . subTest ( brand = ' all_brands ' , num_pandas = num_pandas ) :
total_time = round ( total_times [ num_pandas ] , 2 )
self . _assert_timing ( total_time , total_ref_time [ num_pandas ] )
print ( f ' all brands, total FW query time= { total_time } seconds ' )
if __name__ == " __main__ " :