@@ -814,6 +814,8 @@ def handle(self):
814
814
self .instance .reason = "Device issue (Flash?)"
815
815
with open (d_log , "w" ) as dlog_fp :
816
816
dlog_fp .write (stderr .decode ())
817
+ os .write (write_pipe , b'x' ) # halt the thread
818
+ out_state = "flash_error"
817
819
except subprocess .TimeoutExpired :
818
820
proc .kill ()
819
821
(stdout , stderr ) = proc .communicate ()
@@ -846,12 +848,15 @@ def handle(self):
846
848
847
849
handler_time = time .time () - start_time
848
850
849
- if out_state == "timeout" :
851
+ if out_state in [ "timeout" , "flash_error" ] :
850
852
for c in self .instance .testcase .cases :
851
853
if c not in harness .tests :
852
854
harness .tests [c ] = "BLOCK"
853
855
854
- self .instance .reason = "Timeout"
856
+ if out_state == "timeout" :
857
+ self .instance .reason = "Timeout"
858
+ elif out_state == "flash_error" :
859
+ self .instance .reason = "Flash error"
855
860
856
861
self .instance .results = harness .tests
857
862
@@ -864,7 +869,7 @@ def handle(self):
864
869
865
870
if harness .state :
866
871
self .set_state (harness .state , handler_time )
867
- if harness .state == "failed" :
872
+ if harness .state == "failed" :
868
873
self .instance .reason = "Failed"
869
874
else :
870
875
self .set_state (out_state , handler_time )
@@ -2415,7 +2420,7 @@ def report_out(self, results):
2415
2420
results .done += 1
2416
2421
instance = self .instance
2417
2422
2418
- if instance .status in ["error" , "failed" , "timeout" ]:
2423
+ if instance .status in ["error" , "failed" , "timeout" , "flash_error" ]:
2419
2424
if instance .status == "error" :
2420
2425
results .error += 1
2421
2426
results .failed += 1
@@ -3381,7 +3386,7 @@ def xunit_report(self, filename, platform=None, full_report=False, append=False,
3381
3386
else :
3382
3387
fails += 1
3383
3388
else :
3384
- if instance .status in ["error" , "failed" , "timeout" ]:
3389
+ if instance .status in ["error" , "failed" , "timeout" , "flash_error" ]:
3385
3390
if instance .reason in ['build_error' , 'handler_crash' ]:
3386
3391
errors += 1
3387
3392
else :
@@ -3467,7 +3472,7 @@ def xunit_report(self, filename, platform=None, full_report=False, append=False,
3467
3472
eleTestcase ,
3468
3473
'error' ,
3469
3474
type = "failure" ,
3470
- message = "failed" )
3475
+ message = instance . reason )
3471
3476
log_root = os .path .join (self .outdir , instance .platform .name , instance .testcase .name )
3472
3477
log_file = os .path .join (log_root , "handler.log" )
3473
3478
el .text = self .process_log (log_file )
@@ -3498,7 +3503,7 @@ def xunit_report(self, filename, platform=None, full_report=False, append=False,
3498
3503
name = "%s" % (instance .testcase .name ),
3499
3504
time = "%f" % handler_time )
3500
3505
3501
- if instance .status in ["error" , "failed" , "timeout" ]:
3506
+ if instance .status in ["error" , "failed" , "timeout" , "flash_error" ]:
3502
3507
failure = ET .SubElement (
3503
3508
eleTestcase ,
3504
3509
'failure' ,
0 commit comments