Skip to content

Commit

Permalink
Add a dummy workunit to the end of the run to print out a timestamp t…
Browse files Browse the repository at this point in the history
…hat includes the time spent in the last task.

I noticed some runs seem to hang a long time between the printing of the last timestamp and exiting.

Add a dummy workunit to the end of the run to print out a timestamp that includes the time spent in the last task.

Testing Done:
After this change, I get a timestamp that accounts for the missing time:

```
09:27:19 00:00 [main]
               (To run a reporting server: ./pants server)
09:27:19 00:00   [bootstrap]
09:27:23 00:04   [setup]
09:27:23 00:04     [parse]
               Executing tasks in goals: bootstrap -> imports -> unpack-jars -> deferred-sources -> gen -> resolve -> compile
09:27:26 00:07   [bootstrap]
09:27:26 00:07     [bootstrap-jvm-tools]
09:27:26 00:07   [imports]
09:27:26 00:07     [ivy-imports]
09:27:30 00:11   [unpack-jars]
09:27:30 00:11     [unpack-jars]
09:27:30 00:11   [deferred-sources]
09:27:30 00:11     [deferred-sources]
09:27:30 00:11   [gen]
09:27:30 00:11     [thrift]
09:27:30 00:11     [protoc]
09:27:30 00:11     [antlr]
09:27:31 00:12     [ragel]
09:27:31 00:12     [jaxb]
09:27:31 00:12     [wire]
09:27:31 00:12     [aapt]
09:27:31 00:12   [resolve]
09:27:31 00:12     [ivy]
09:27:32 00:13       [ivy-resolve]
09:27:40 00:21   [compile]
09:27:40 00:21     [compile]
09:27:40 00:21     [jvm]
09:27:40 00:21       [jvm-compilers]
09:27:59 00:40   [complete]
               SUCCESS
```

CI is green at https://travis-ci.org/pantsbuild/pants/builds/57973122

Bugs closed: 1375, 1393

Reviewed at https://rbcommons.com/s/twitter/r/2054/
  • Loading branch information
ericzundel committed Apr 10, 2015
1 parent fcf80bd commit b312459
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/python/pants/goal/run_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ def end(self):

SubprocPool.shutdown(self._aborted)

# Run a dummy work unit to write out one last timestamp
with self.new_workunit("complete"):
pass

self.end_workunit(self._main_root_workunit)

outcome = self._main_root_workunit.outcome()
Expand Down

0 comments on commit b312459

Please sign in to comment.