11: def run
12: @listener.starting(self)
13: while work_unit = next_work_unit
14: @listener.starting_work(self, work_unit)
15:
16: result = begin
17: work_unit.run
18: rescue Exception => error
19: Error.new(work_unit, error)
20: end
21:
22: @listener.finished_work(self, work_unit, result)
23: @blackboard.write_result result
24: if ENV['DEEP_TEST_SHOW_WORKER_DOTS'] == 'yes'
25: $stdout.print '.'
26: $stdout.flush
27: end
28: end
29: rescue Server::NoWorkUnitsRemainingError
30: DeepTest.logger.debug("Worker #{number}: no more work to do")
31: end