|  |  |  | @ -1,4 +1,5 @@ | 
			
		
	
		
			
				
					|  |  |  |  | #!/usr/bin/env python3 | 
			
		
	
		
			
				
					|  |  |  |  | import bz2 | 
			
		
	
		
			
				
					|  |  |  |  | import math | 
			
		
	
		
			
				
					|  |  |  |  | import json | 
			
		
	
		
			
				
					|  |  |  |  | import os | 
			
		
	
	
		
			
				
					|  |  |  | @ -161,6 +162,7 @@ class TestOnroad(unittest.TestCase): | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     # use the second segment by default as it's the first full segment | 
			
		
	
		
			
				
					|  |  |  |  |     cls.lr = list(LogReader(os.path.join(str(cls.segments[1]), "rlog"))) | 
			
		
	
		
			
				
					|  |  |  |  |     cls.log_path = cls.segments[1] | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |   @cached_property | 
			
		
	
		
			
				
					|  |  |  |  |   def service_msgs(self): | 
			
		
	
	
		
			
				
					|  |  |  | @ -191,6 +193,26 @@ class TestOnroad(unittest.TestCase): | 
			
		
	
		
			
				
					|  |  |  |  |     big_logs = [f for f, n in cnt.most_common(3) if n / sum(cnt.values()) > 30.] | 
			
		
	
		
			
				
					|  |  |  |  |     self.assertEqual(len(big_logs), 0, f"Log spam: {big_logs}") | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |   def test_log_sizes(self): | 
			
		
	
		
			
				
					|  |  |  |  |     for f in self.log_path.iterdir(): | 
			
		
	
		
			
				
					|  |  |  |  |       assert f.is_file() | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |       sz = f.stat().st_size / 1e6 | 
			
		
	
		
			
				
					|  |  |  |  |       if f.name in ("qlog", "rlog"): | 
			
		
	
		
			
				
					|  |  |  |  |         with open(f, 'rb') as ff: | 
			
		
	
		
			
				
					|  |  |  |  |           sz = len(bz2.compress(ff.read())) / 1e6 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |       if f.name == "qcamera.ts": | 
			
		
	
		
			
				
					|  |  |  |  |         assert 2.15 < sz < 2.35 | 
			
		
	
		
			
				
					|  |  |  |  |       elif f.name == "qlog": | 
			
		
	
		
			
				
					|  |  |  |  |         assert 0.7 < sz < 0.95 | 
			
		
	
		
			
				
					|  |  |  |  |       elif f.name == "rlog": | 
			
		
	
		
			
				
					|  |  |  |  |         assert 5 < sz < 50 | 
			
		
	
		
			
				
					|  |  |  |  |       elif f.name.endswith('.hevc'): | 
			
		
	
		
			
				
					|  |  |  |  |         assert 70 < sz < 77 | 
			
		
	
		
			
				
					|  |  |  |  |       else: | 
			
		
	
		
			
				
					|  |  |  |  |         raise NotImplementedError | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |   def test_ui_timings(self): | 
			
		
	
		
			
				
					|  |  |  |  |     result = "\n" | 
			
		
	
		
			
				
					|  |  |  |  |     result += "------------------------------------------------\n" | 
			
		
	
	
		
			
				
					|  |  |  | 
 |