ApexAI / apex_rostest

Framework for ROS2 Integration Testing
5 stars 6 forks source link

proc_lookup can have an exception while trying to raise an exception #35

Closed pbaughman closed 5 years ago

pbaughman commented 5 years ago

https://github.com/ApexAI/apex_rostest/blob/7b08ad860c64f586e50094f1aa071fc50ec28654/apex_launchtest/apex_launchtest/util/proc_lookup.py#L85

If the process hasn't been launched yet, we're not going to be able to look up the process name yet. You'll get an exception that looks like this:

  File "...path/install/lib/python3.5/site-packages/apex_launchtest/proc_info_handler.py", line 126, in assertWaitForShutdown 
    timeout=timeout                                                                                                                                             
  File "/usr/lib/python3.5/threading.py", line 319, in wait_for                                                                                                 
    result = predicate()                                                                                                                                        
  File "...path/install/lib/python3.5/site-packages/apex_launchtest/proc_info_handler.py", line 117, in proc_is_shutdown      
    strict_proc_matching=True                                                                                                                                   
  File "...path/install/lib/python3.5/site-packages/apex_launchtest/util/proc_lookup.py", line 85, in resolveProcesses        
    "No data recorded for proc {}".format(_proc_to_name_and_args(process))                                                                                      
  File "...path/install/lib/python3.5/site-packages/apex_launchtest/util/proc_lookup.py", line 27, in _proc_to_name_and_args  
    proc.process_details['name'],                                                                                                                               
TypeError: 'NoneType' object is not subscriptable