tests: ask any chg instance to terminate before looking at sqlite dbs

There are spurious errors in CI where the database is still locked, so
force the daemon to quit to get deterministic behavior. Since the kill
command itself is racy, also sleep 2s to give the server time to wake up
and exit.
23 jobs for topic/default/fix-chg in 33 minutes and 13 seconds (queued for 4 seconds)
latest
Status Job ID Name Coverage
  Tests
passed #178026
checks-py2

00:02:56

passed #178027
checks-py3

00:04:25

passed #178028
rust-cargo-test-py2

00:01:38

passed #178029
rust-cargo-test-py3

00:01:28

passed #178030
test-py2

00:21:44

passed #178037
test-py2-chg

00:20:57

passed #178032
test-py2-pure

00:20:26

passed #178034
test-py2-rust

00:25:28

passed #178031
test-py3

00:12:43

failed #178048
test-py3-chg

00:07:21

passed #178033
test-py3-pure

00:12:47

passed #178036
test-py3-rhg

00:10:39

passed #178035
test-py3-rust

00:15:29

passed #178047
test-py3-chg

00:07:19

passed #178046
test-py3-chg

00:07:19

passed #178045
test-py3-chg

00:07:25

failed #178044
test-py3-chg

00:06:44

passed #178043
test-py3-chg

00:07:03

passed #178042
test-py3-chg

00:07:06

passed #178041
test-py3-chg

00:07:24

passed #178040
test-py3-chg

00:09:10

passed #178038
test-py3-chg

00:09:26

 
  Phabricator
passed #178039
phabricator-refresh

00:00:21

 
Name Stage Failure
failed
test-py3-chg Tests
Skipped test-verify-repo-operations.py: missing feature: allow slow tests (use --allow-slow-tests)
Skipped test-wireproto-command-capabilities.t: system supports running with chg
Failed test-racy-mutations.t#fail-if-detected: output changed
Failed test-racy-mutations.t#skip-detection: output changed
# Ran 872 tests, 82 skipped, 2 failed.
python hash seed: 2250400301
Running after_script
Uploading artifacts for failed job
ERROR: Job failed: exit code 1