OLD | NEW |
1 """ | 1 """ |
2 The main job wrapper for the server side. | 2 The main job wrapper for the server side. |
3 | 3 |
4 This is the core infrastructure. Derived from the client side job.py | 4 This is the core infrastructure. Derived from the client side job.py |
5 | 5 |
6 Copyright Martin J. Bligh, Andy Whitcroft 2007 | 6 Copyright Martin J. Bligh, Andy Whitcroft 2007 |
7 """ | 7 """ |
8 | 8 |
9 import getpass, os, sys, re, stat, tempfile, time, select, subprocess, platform | 9 import getpass, os, sys, re, stat, tempfile, time, select, subprocess, platform |
10 import Queue, threading | 10 import Queue, threading |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 Args: | 474 Args: |
475 tests: List of tests to run. | 475 tests: List of tests to run. |
476 machines: list of machines to use. | 476 machines: list of machines to use. |
477 """ | 477 """ |
478 # The Queue is thread safe, but since a machine may have to search | 478 # The Queue is thread safe, but since a machine may have to search |
479 # through the queue to find a valid test the lock provides exclusive | 479 # through the queue to find a valid test the lock provides exclusive |
480 # queue access for more than just the get call. | 480 # queue access for more than just the get call. |
481 test_queue = Queue.Queue() | 481 test_queue = Queue.Queue() |
482 test_queue_lock = threading.Lock() | 482 test_queue_lock = threading.Lock() |
483 | 483 |
484 machine_workers = [server_job_utils.machine_worker(machine, | 484 machine_workers = [server_job_utils.machine_worker(self, |
| 485 machine, |
485 self.resultdir, | 486 self.resultdir, |
486 test_queue, | 487 test_queue, |
487 test_queue_lock) | 488 test_queue_lock) |
488 for machine in machines] | 489 for machine in machines] |
489 | 490 |
490 # To (potentially) speed up searching for valid tests create a list of | 491 # To (potentially) speed up searching for valid tests create a list of |
491 # unique attribute sets present in the machines for this job. If sets | 492 # unique attribute sets present in the machines for this job. If sets |
492 # were hashable we could just use a dictionary for fast verification. | 493 # were hashable we could just use a dictionary for fast verification. |
493 # This at least reduces the search space from the number of machines to | 494 # This at least reduces the search space from the number of machines to |
494 # the number of unique machines. | 495 # the number of unique machines. |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 intervals = self.disabled_warnings.setdefault(warning_type, []) | 1207 intervals = self.disabled_warnings.setdefault(warning_type, []) |
1207 if not intervals or intervals[-1][1] is not None: | 1208 if not intervals or intervals[-1][1] is not None: |
1208 intervals.append((int(current_time_func()), None)) | 1209 intervals.append((int(current_time_func()), None)) |
1209 | 1210 |
1210 | 1211 |
1211 def enable_warnings(self, warning_type, current_time_func=time.time): | 1212 def enable_warnings(self, warning_type, current_time_func=time.time): |
1212 """As of now, enables all further warnings of this type.""" | 1213 """As of now, enables all further warnings of this type.""" |
1213 intervals = self.disabled_warnings.get(warning_type, []) | 1214 intervals = self.disabled_warnings.get(warning_type, []) |
1214 if intervals and intervals[-1][1] is None: | 1215 if intervals and intervals[-1][1] is None: |
1215 intervals[-1] = (intervals[-1][0], int(current_time_func())) | 1216 intervals[-1] = (intervals[-1][0], int(current_time_func())) |
OLD | NEW |