symbench / symbench-athens-client

Python client for Symbench's UAV workflow runs.
Apache License 2.0
0 stars 2 forks source link

Figure out data.zip issues with number of samples > 1. #107

Open umesh-timalsina opened 3 years ago

umesh-timalsina commented 3 years ago

This is absolutely not critical, but I got this error with a 50 sample run (the actual Jenkins UAV Workflow job finished without any problems, I assume this is a race condition when trying to access the data.zip):

2021-08-18 20:59:19,106 - UAVWorkflowRunner - DEBUG - Still running the job UAV_Workflows
2021-08-18 20:59:24,228 - UAVWorkflowRunner - DEBUG - Still running the job UAV_Workflows
2021-08-18 20:59:29,340 - UAVWorkflowRunner - DEBUG - Still running the job UAV_Workflows
2021-08-18 20:59:34,463 - UAVWorkflowRunner - DEBUG - Still running the job UAV_Workflows
2021-08-18 20:59:39,569 - UAVWorkflowRunner - DEBUG - Still running the job UAV_Workflows
2021-08-18 20:59:44,672 - UAVWorkflowRunner - DEBUG - Still running the job UAV_Workflows
2021-08-18 20:59:44,864 - UAVWorkflowRunner - INFO - Job UAV_Workflows is finished. The result is SUCCESS
---------------------------------------------------------------------------
BadZipFile                                Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_2600/1925723299.py in <module>
     17 design.arm_length = (180,400)
     18 design.support_length = (50,100)
---> 19 result = runner.fly_all_paths(design, num_samples=50, clone=False, clear=True, requested_lateral_speed=(5,33), requested_vertical_speed=-2)
     20 result

c:\symbench\symbench-athens-client\symbench_athens_client\uav_workflows.py in fly_all_paths(self, design, num_samples, clone, clear, **kwargs)
    659         )
    660 
--> 661         results = self._run_uav_workflow(all_paths_flight)
    662 
    663         if clear:

c:\symbench\symbench-athens-client\symbench_athens_client\uav_workflows.py in _run_uav_workflow(self, pipeline)
    181         while not build.api_json()["artifacts"]:
    182             time.sleep(2)
--> 183         return self._results_from_build(build)
    184 
    185     def run_hover_calc(self, design, num_samples=1, clone=True, clear=True):

c:\symbench\symbench-athens-client\symbench_athens_client\uav_workflows.py in _results_from_build(self, build)
    148                         zip_artifact.write(artifacts_content)
    149 
--> 150                     with zipfile.ZipFile(filename) as zip_file:
    151                         with zip_file.open("output.csv") as csv_file:
    152                             csv_str = csv_file.read().decode("utf-8")

c:\program files\python39\lib\zipfile.py in __init__(self, file, mode, compression, allowZip64, compresslevel, strict_timestamps)
   1255         try:
   1256             if mode == 'r':
-> 1257                 self._RealGetContents()
   1258             elif mode in ('w', 'x'):
   1259                 # set the modified flag so central directory gets written

c:\program files\python39\lib\zipfile.py in _RealGetContents(self)
   1322             raise BadZipFile("File is not a zip file")
   1323         if not endrec:
-> 1324             raise BadZipFile("File is not a zip file")
   1325         if self.debug > 1:
   1326             print(endrec)

BadZipFile: File is not a zip file