Merge "Add support for override-checkout, deprecate override-branch" into feature/zuulv3
diff --git a/zuul/cmd/executor.py b/zuul/cmd/executor.py
index 70c80c5..979989d 100755
--- a/zuul/cmd/executor.py
+++ b/zuul/cmd/executor.py
@@ -108,6 +108,7 @@
         os.setgroups(groups)
         os.setgid(pw.pw_gid)
         os.setuid(pw.pw_uid)
+        os.chdir(pw.pw_dir)
         os.umask(0o022)
 
     def main(self, daemon=True):
diff --git a/zuul/driver/github/githubconnection.py b/zuul/driver/github/githubconnection.py
index 1186aca..c211164 100644
--- a/zuul/driver/github/githubconnection.py
+++ b/zuul/driver/github/githubconnection.py
@@ -135,7 +135,7 @@
     """Move events from GitHub into the scheduler"""
 
     log = logging.getLogger("zuul.GithubEventConnector")
-    delay = 3.0
+    delay = 10.0
 
     def __init__(self, connection):
         super(GithubEventConnector, self).__init__()
diff --git a/zuul/executor/server.py b/zuul/executor/server.py
index 7bcd71c..469d6f3 100644
--- a/zuul/executor/server.py
+++ b/zuul/executor/server.py
@@ -1702,7 +1702,7 @@
 
     def unregister_work(self):
         self.accepting_work = False
-        self.executor_worker.unregisterFunction("executor:execute")
+        self.executor_worker.unRegisterFunction("executor:execute")
 
     def stop(self):
         self.log.debug("Stopping")
diff --git a/zuul/scheduler.py b/zuul/scheduler.py
index 8db9e46..73fa923 100644
--- a/zuul/scheduler.py
+++ b/zuul/scheduler.py
@@ -374,9 +374,10 @@
                 self.statsd.incr(key)
                 # zuul.tenant.<tenant>.pipeline.<pipeline>.project.
                 #  <host>.<project>.<branch>.job.<job>.wait_time
-                key = '%s.wait_time' % jobkey
-                dt = int((build.start_time - build.execute_time) * 1000)
-                self.statsd.timing(key, dt)
+                if build.start_time:
+                    key = '%s.wait_time' % jobkey
+                    dt = int((build.start_time - build.execute_time) * 1000)
+                    self.statsd.timing(key, dt)
         except Exception:
             self.log.exception("Exception reporting runtime stats")
         event = BuildCompletedEvent(build)