| OLD | NEW |
| 1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
| 2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
| 3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
| 4 # met: | 4 # met: |
| 5 # | 5 # |
| 6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
| 7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
| 8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
| 9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
| 10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 def HasRun(self, test): | 53 def HasRun(self, test): |
| 54 # The runners that call this have a lock anyway, so this is safe. | 54 # The runners that call this have a lock anyway, so this is safe. |
| 55 self.results_queue.append(test) | 55 self.results_queue.append(test) |
| 56 | 56 |
| 57 def _SenderThread(self): | 57 def _SenderThread(self): |
| 58 keep_running = True | 58 keep_running = True |
| 59 tests = [] | 59 tests = [] |
| 60 self.sender_lock.acquire() | 60 self.sender_lock.acquire() |
| 61 while keep_running: | 61 while keep_running: |
| 62 time.sleep(0.1) | 62 time.sleep(0.1) |
| 63 t1 = time.time() | |
| 64 # This should be "atomic enough" without locking :-) | 63 # This should be "atomic enough" without locking :-) |
| 65 # (We don't care which list any new elements get appended to, as long | 64 # (We don't care which list any new elements get appended to, as long |
| 66 # as we don't lose any and the last one comes last.) | 65 # as we don't lose any and the last one comes last.) |
| 67 current = self.results_queue | 66 current = self.results_queue |
| 68 self.results_queue = [] | 67 self.results_queue = [] |
| 69 for c in current: | 68 for c in current: |
| 70 if c is None: | 69 if c is None: |
| 71 keep_running = False | 70 keep_running = False |
| 72 else: | 71 else: |
| 73 tests.append(c) | 72 tests.append(c) |
| 74 if keep_running and len(tests) < 1: | 73 if keep_running and len(tests) < 1: |
| 75 continue # Wait for more results. | 74 continue # Wait for more results. |
| 76 if len(tests) < 1: break # We're done here. | 75 if len(tests) < 1: break # We're done here. |
| 77 result = [] | 76 result = [] |
| 78 for t in tests: | 77 for t in tests: |
| 79 result.append(t.PackResult()) | 78 result.append(t.PackResult()) |
| 80 compression.Send(result, self.sock) | 79 try: |
| 80 compression.Send(result, self.sock) |
| 81 except: |
| 82 self.runner.terminate = True |
| 81 for t in tests: | 83 for t in tests: |
| 82 self.server.CompareOwnPerf(t, self.context.arch, self.context.mode) | 84 self.server.CompareOwnPerf(t, self.context.arch, self.context.mode) |
| 83 tests = [] | 85 tests = [] |
| 84 self.sender_lock.release() | 86 self.sender_lock.release() |
| 85 | 87 |
| 86 | 88 |
| 87 def Execute(workspace, ctx, tests, sock, server): | 89 def Execute(workspace, ctx, tests, sock, server): |
| 88 suite_paths = utils.GetSuitePaths(os.path.join(workspace, "test")) | 90 suite_paths = utils.GetSuitePaths(os.path.join(workspace, "test")) |
| 89 suites = [] | 91 suites = [] |
| 90 for root in suite_paths: | 92 for root in suite_paths: |
| (...skipping 18 matching lines...) Expand all Loading... |
| 109 progress_indicator = EndpointProgress(sock, server, ctx) | 111 progress_indicator = EndpointProgress(sock, server, ctx) |
| 110 runner = execution.Runner(suites, progress_indicator, ctx) | 112 runner = execution.Runner(suites, progress_indicator, ctx) |
| 111 try: | 113 try: |
| 112 runner.Run(server.jobs) | 114 runner.Run(server.jobs) |
| 113 except IOError, e: | 115 except IOError, e: |
| 114 if e.errno == 2: | 116 if e.errno == 2: |
| 115 message = ("File not found: %s, maybe you forgot to 'git add' it?" % | 117 message = ("File not found: %s, maybe you forgot to 'git add' it?" % |
| 116 e.filename) | 118 e.filename) |
| 117 else: | 119 else: |
| 118 message = "%s" % e | 120 message = "%s" % e |
| 119 compression.Send([-1, message], sock) | 121 compression.Send([[-1, message]], sock) |
| 120 progress_indicator.HasRun(None) # Sentinel to signal the end. | 122 progress_indicator.HasRun(None) # Sentinel to signal the end. |
| 121 progress_indicator.sender_lock.acquire() # Released when sending is done. | 123 progress_indicator.sender_lock.acquire() # Released when sending is done. |
| 122 progress_indicator.sender_lock.release() | 124 progress_indicator.sender_lock.release() |
| OLD | NEW |