[Title] Fixed the bug that the "FINISH" log for sub-job is not shown
authordonghee yang <donghee.yang@samsung.com>
Wed, 20 Mar 2013 14:49:59 +0000 (23:49 +0900)
committerdonghee yang <donghee.yang@samsung.com>
Wed, 20 Mar 2013 14:49:59 +0000 (23:49 +0900)
src/build_server/MultiBuildJob.rb

index 8bcf6a5d6e7f7e1eda0568c645bb47ae82fe7d89..1246de4f8755ebdcc134a2e93b8da43d337971b1 100644 (file)
@@ -364,30 +364,32 @@ class MultiBuildJob < CommonJob
                while not all_jobs_finished
                        all_jobs_finished = true
                        @sub_jobs.each do |job|
+                               job_status = job.status
                                # check status chanaged, if then print
-                               if job_status_map[ job.id ]  != job.status then
-                                       @log.info(" * Sub-Job \"#{job.get_project().name}(#{job.os})\" has entered \"#{job.status}\" state. (#{job.id})", Log::LV_USER)
-                                       job_status_map[ job.id ] = job.status
+                               if job_status_map[ job.id ]  != job_status then
+                                       @log.info(" * Sub-Job \"#{job.get_project().name}(#{job.os})\" has entered \"#{job_status}\" state. (#{job.id})", Log::LV_USER)
+                                       job_status_map[ job.id ] = job_status
                                end
                                # check all jobs are finished
-                               if job.status != "ERROR" and job.status != "FINISHED" and job.status != "CANCELED" then
+                               if job_status != "ERROR" and job_status != "FINISHED" and job_status != "CANCELED" then
                                        all_jobs_finished = false
                                end
                                # check there is some error or cancel
                                if stop_status == "FINISHED" and
-                                       (job.status == "ERROR" or job.status == "CANCELED") then
+                                       (job_status == "ERROR" or job_status == "CANCELED") then
                                        # write url
                                        write_log_url(job)
                                        # cancel all other un-finished jobs
                                        @sub_jobs.each do |sub|
-                                               if sub.status != "ERROR" and sub.status != "FINISHED" and
-                                                       sub.status != "CANCELED" and sub.event == "NONE" then
+                                               sub_status = sub.status
+                                               if sub_status != "ERROR" and sub_status != "FINISHED" and
+                                                       sub_status != "CANCELED" and sub.event == "NONE" then
                                                        @log.info(" * Sub-Job \"#{sub.get_project().name}(#{sub.os})\" has entered \"CANCELING\" state. (#{sub.id})", Log::LV_USER)
                                                        sub.event = "CANCEL"
                                                end
                                        end
 
-                                       stop_status = job.status
+                                       stop_status = job_status
                                        break
                                end
                        end