Repository: kopia/kopia
Pull request #2745 (2023-02-08 23:02:29)

build(deps): bump golang.org/x/oauth2 from 0.3.0 to 0.5.0
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.3.0 to 0.5.0.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/golang/oauth2/commit/adbaf66a0bae46206ed661df3c5bae3752a3347c"><code>adbaf66</code></a> go.mod: update golang.org/x dependencies</li>
<li><a href="https://github.com/golang/oauth2/commit/e07593a4c41a489556d019d1ad4d82e9ee66b4a7"><code>e07593a</code></a> oauth2: remove direct dependency on golang.org/x/net</li>
<li><a href="https://github.com/golang/oauth2/commit/34ffb07a9918c019c2d5080521104d2598ed8266"><code>34ffb07</code></a> go.mod: update golang.org/x dependencies</li>
<li>See full diff in <a href="https://github.com/golang/oauth2/compare/v0.3.0...v0.5.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/oauth2&package-manager=go_modules&previous-version=0.3.0&new-version=0.5.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
Dependabot will merge this PR once it's up-to-date and CI passes on it, as requested by @kopia-builder.

[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

dependabot[bot]: One of your CI runs failed on this pull request, so Dependabot won't merge it.

Dependabot will still automatically merge this pull request if you amend it and your tests pass.
codecov[bot]: # [Codecov](https://codecov.io/gh/kopia/kopia/pull/2745?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia) Report
Base: **75.19**% // Head: **75.18**% // Decreases project coverage by **`-0.02%`** :warning:
> Coverage data is based on head [(`c1c242e`)](https://codecov.io/gh/kopia/kopia/pull/2745?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia) compared to base [(`6cd9e48`)](https://codecov.io/gh/kopia/kopia/commit/6cd9e48a03ee898866981eae84f17bdc51d7d051?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia).
> Patch has no changes to coverable lines.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##           master    #2745      +/-   ##
==========================================
- Coverage   75.19%   75.18%   -0.02%     
==========================================
  Files         457      457              
  Lines       35868    35868              
==========================================
- Hits        26972    26968       -4     
- Misses       6994     6998       +4     
  Partials     1902     1902              
```


| [Impacted Files](https://codecov.io/gh/kopia/kopia/pull/2745?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia) | Coverage Δ | |
|---|---|---|
| [internal/cache/persistent\_lru\_cache.go](https://codecov.io/gh/kopia/kopia/pull/2745?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia#diff-aW50ZXJuYWwvY2FjaGUvcGVyc2lzdGVudF9scnVfY2FjaGUuZ28=) | `96.06% <0.00%> (-1.75%)` | :arrow_down: |
| [internal/logfile/logfile.go](https://codecov.io/gh/kopia/kopia/pull/2745?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia#diff-aW50ZXJuYWwvbG9nZmlsZS9sb2dmaWxlLmdv) | `78.77% <0.00%> (-0.97%)` | :arrow_down: |
| [internal/server/source\_manager.go](https://codecov.io/gh/kopia/kopia/pull/2745?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia#diff-aW50ZXJuYWwvc2VydmVyL3NvdXJjZV9tYW5hZ2VyLmdv) | `80.66% <0.00%> (-0.77%)` | :arrow_down: |
| [snapshot/snapshotfs/upload.go](https://codecov.io/gh/kopia/kopia/pull/2745?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia#diff-c25hcHNob3Qvc25hcHNob3Rmcy91cGxvYWQuZ28=) | `83.70% <0.00%> (-0.34%)` | :arrow_down: |
| [internal/epoch/epoch\_manager.go](https://codecov.io/gh/kopia/kopia/pull/2745?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia#diff-aW50ZXJuYWwvZXBvY2gvZXBvY2hfbWFuYWdlci5nbw==) | `85.78% <0.00%> (+0.48%)` | :arrow_up: |
| [internal/providervalidation/providervalidation.go](https://codecov.io/gh/kopia/kopia/pull/2745?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia#diff-aW50ZXJuYWwvcHJvdmlkZXJ2YWxpZGF0aW9uL3Byb3ZpZGVydmFsaWRhdGlvbi5nbw==) | `65.68% <0.00%> (+0.73%)` | :arrow_up: |
| [snapshot/snapshotfs/repofs.go](https://codecov.io/gh/kopia/kopia/pull/2745?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia#diff-c25hcHNob3Qvc25hcHNob3Rmcy9yZXBvZnMuZ28=) | `80.80% <0.00%> (+1.51%)` | :arrow_up: |
| [repo/blob/throttling/throttling\_semaphore.go](https://codecov.io/gh/kopia/kopia/pull/2745?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia#diff-cmVwby9ibG9iL3Rocm90dGxpbmcvdGhyb3R0bGluZ19zZW1hcGhvcmUuZ28=) | `100.00% <0.00%> (+2.94%)` | :arrow_up: |

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia)

</details>

[:umbrella: View full report at Codecov](https://codecov.io/gh/kopia/kopia/pull/2745?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia).   
:loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia).


Patch:
diff --git a/.golangci.yml b/.golangci.yml
index a33d726a..5854f122 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -104,6 +104,9 @@ issues:
     - path: \.pb\.go
       linters:
       - gofmt
+    - path: reporter.go
+      linters:
+      - musttag
     - path: _test\.go|testing|tests|test_env|fshasher|fault
       linters:
       - contextcheck
@@ -115,6 +118,7 @@ issues:
       - gocognit
       - gomnd
       - gosec
+      - musttag
       - nestif
       - revive
       - nolintlint
diff --git a/go.mod b/go.mod
index f4c6b91d..065114c1 100644
--- a/go.mod
+++ b/go.mod
@@ -24,7 +24,7 @@ require (
 	github.com/google/uuid v1.3.0
 	github.com/gorilla/mux v1.8.0
 	github.com/hanwen/go-fuse/v2 v2.1.1-0.20220112183258-f57e95bda82d
-	github.com/klauspost/compress v1.15.12
+	github.com/klauspost/compress v1.15.15
 	github.com/klauspost/cpuid/v2 v2.1.1 // indirect
 	github.com/klauspost/pgzip v1.2.5
 	github.com/kylelemons/godebug v1.1.0
@@ -52,7 +52,7 @@ require (
 	golang.org/x/crypto v0.5.0
 	golang.org/x/mod v0.7.0
 	golang.org/x/net v0.6.0
-	golang.org/x/oauth2 v0.3.0
+	golang.org/x/oauth2 v0.5.0
 	golang.org/x/sync v0.1.0
 	golang.org/x/sys v0.5.0
 	golang.org/x/term v0.5.0
diff --git a/go.sum b/go.sum
index b5c4ab8f..213110b1 100644
--- a/go.sum
+++ b/go.sum
@@ -177,8 +177,8 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm
 github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
 github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
 github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
-github.com/klauspost/compress v1.15.12 h1:YClS/PImqYbn+UILDnqxQCZ3RehC9N318SU3kElDUEM=
-github.com/klauspost/compress v1.15.12/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM=
+github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw=
+github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4=
 github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
 github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
 github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c=
@@ -345,8 +345,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
 golang.org/x/net v0.6.0 h1:L4ZwwTvKW9gr0ZMS1yrHD9GZhIuVjOBBnaKH+SPQK0Q=
 golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
-golang.org/x/oauth2 v0.3.0 h1:6l90koy8/LaBLmLu8jpHeHexzMwEita0zFfYlggy2F8=
-golang.org/x/oauth2 v0.3.0/go.mod h1:rQrIauxkUhJ6CuwEXwymO2/eh4xz2ZWF1nBkcxS+tGk=
+golang.org/x/oauth2 v0.5.0 h1:HuArIo48skDwlrvM3sEdHXElYslAMsf3KwRkkW4MC4s=
+golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I=
 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
diff --git a/internal/serverapi/serverapi.go b/internal/serverapi/serverapi.go
index 507916d0..38b97076 100644
--- a/internal/serverapi/serverapi.go
+++ b/internal/serverapi/serverapi.go
@@ -123,6 +123,8 @@ type CheckRepositoryExistsRequest struct {
 }
 
 // ConnectRepositoryRequest contains request to connect to a repository.
+//
+//nolint:musttag // false positive
 type ConnectRepositoryRequest struct {
 	Storage             blob.ConnectionInfo `json:"storage"`
 	Password            string              `json:"password"`
diff --git a/internal/sparsefile/sparsefile.go b/internal/sparsefile/sparsefile.go
index 9e538e7c..866f233c 100644
--- a/internal/sparsefile/sparsefile.go
+++ b/internal/sparsefile/sparsefile.go
@@ -3,7 +3,6 @@
 
 import (
 	"io"
-	"os"
 
 	"github.com/pkg/errors"
 
@@ -27,7 +26,7 @@ func copyBuffer(dst io.WriteSeeker, src io.Reader, buf []byte) (written int64, e
 		if nr > 0 { //nolint:nestif
 			// If non-zero data is read, write it. Otherwise, skip forwards.
 			if isAllZero(buf) {
-				dst.Seek(int64(nr), os.SEEK_CUR) //nolint:errcheck
+				dst.Seek(int64(nr), io.SeekCurrent) //nolint:errcheck
 				written += int64(nr)
 
 				continue
diff --git a/repo/blob/config.go b/repo/blob/config.go
index 215fe128..ac6cb5ed 100644
--- a/repo/blob/config.go
+++ b/repo/blob/config.go
@@ -7,6 +7,8 @@
 )
 
 // ConnectionInfo represents JSON-serializable configuration of a blob storage.
+//
+//nolint:musttag // we use custom JSON marshaling.
 type ConnectionInfo struct {
 	Type   string
 	Config interface{}
diff --git a/repo/ecc/ecc_rs_crc.go b/repo/ecc/ecc_rs_crc.go
index 91df05bc..beb70365 100644
--- a/repo/ecc/ecc_rs_crc.go
+++ b/repo/ecc/ecc_rs_crc.go
@@ -402,8 +402,7 @@ type sizesInfo struct {
 	enc          reedsolomon.Encoder
 }
 
-//nolint:unused // Used in tests
-func (s *sizesInfo) computeFinalFileSize(size int) int {
+func computeFinalFileSize(s *sizesInfo, size int) int {
 	if s.StorePadding {
 		return computeFinalFileSizeWithPadding(s.DataShards, s.ParityShards, s.ShardSize, s.Blocks)
 	}
@@ -415,7 +414,6 @@ func computeFinalFileSizeWithPadding(dataShards, parityShards, shardSize, blocks
 	return (parityShards + dataShards) * (crcSize + shardSize) * blocks
 }
 
-//nolint:unused // Used in tests
 func computeFinalFileSizeWithoutPadding(inputSize, parityShards, shardSize, blocks int) int {
 	sizePlusLength := lengthSize + inputSize
 	return parityShards*(crcSize+shardSize)*blocks + sizePlusLength + ceilInt(sizePlusLength, shardSize)*crcSize
diff --git a/repo/format/repository_config.go b/repo/format/repository_config.go
index 69d81b30..5fd58b1a 100644
--- a/repo/format/repository_config.go
+++ b/repo/format/repository_config.go
@@ -10,6 +10,8 @@
 
 // RepositoryConfig describes the format of objects in a repository.
 // The contents of this object are stored encrypted since they contain sensitive key material.
+//
+//nolint:musttag // false positive
 type RepositoryConfig struct {
 	ContentFormat
 	ObjectFormat
diff --git a/tools/gettool/checksums.txt b/tools/gettool/checksums.txt
index 1f07ee91..456c1143 100644
--- a/tools/gettool/checksums.txt
+++ b/tools/gettool/checksums.txt
@@ -8,12 +8,12 @@ https://github.com/gohugoio/hugo/releases/download/v0.89.2/hugo_extended_0.89.2_
 https://github.com/gohugoio/hugo/releases/download/v0.89.2/hugo_extended_0.89.2_macOS-64bit.tar.gz: f9185f6d14eb84d9029d59cdd8a977f2f0be334c4f9d38f2099e56a0c0734731
 https://github.com/gohugoio/hugo/releases/download/v0.89.2/hugo_extended_0.89.2_macOS-ARM64.tar.gz: 99a5b4738528d4858a0237199eabc7aee77674c8c7edcfe269efb4b515566cec
 https://github.com/gohugoio/hugo/releases/download/v0.89.2/hugo_extended_0.89.2_windows-64bit.zip: 8d79db4f24fbf023c64862c37d09291ac216875dad91e71dd8753cb5883e4274
-https://github.com/golangci/golangci-lint/releases/download/v1.50.1/golangci-lint-1.50.1-darwin-amd64.tar.gz: 0f615fb8c364f6e4a213f2ed2ff7aa1fc2b208addf29511e89c03534067bbf57
-https://github.com/golangci/golangci-lint/releases/download/v1.50.1/golangci-lint-1.50.1-darwin-arm64.tar.gz: 3ca9753d7804b34f9165427fbe339dbea69bd80be8a10e3f02c6037393b2e1c4
-https://github.com/golangci/golangci-lint/releases/download/v1.50.1/golangci-lint-1.50.1-linux-amd64.tar.gz: 4ba1dc9dbdf05b7bdc6f0e04bdfe6f63aa70576f51817be1b2540bbce017b69a
-https://github.com/golangci/golangci-lint/releases/download/v1.50.1/golangci-lint-1.50.1-linux-arm64.tar.gz: 3ea0a6d5946340f6831646e2c67a317dd9b35bdc4e09b2df953a86f09ba05d74
-https://github.com/golangci/golangci-lint/releases/download/v1.50.1/golangci-lint-1.50.1-linux-armv6.tar.gz: 980832f12fbdd0a8e636666839b168c2bbf0ca573ff50b042d3977f65c4987d7
-https://github.com/golangci/golangci-lint/releases/download/v1.50.1/golangci-lint-1.50.1-windows-amd64.zip: 8c2da214884db02fb7f3d929672c515ae3b9d10defad4dd661c4ab365a316d68
+https://github.com/golangci/golangci-lint/releases/download/v1.51.1/golangci-lint-1.51.1-darwin-amd64.tar.gz: fba08acc4027f69f07cef48fbff70b8a7ecdfaa1c2aba9ad3fb31d60d9f5d4bc
+https://github.com/golangci/golangci-lint/releases/download/v1.51.1/golangci-lint-1.51.1-darwin-arm64.tar.gz: 75b8f0ff3a4e68147156be4161a49d4576f1be37a0b506473f8c482140c1e7f2
+https://github.com/golangci/golangci-lint/releases/download/v1.51.1/golangci-lint-1.51.1-linux-amd64.tar.gz: 17aeb26c76820c22efa0e1838b0ab93e90cfedef43fbfc9a2f33f27eb9e5e070
+https://github.com/golangci/golangci-lint/releases/download/v1.51.1/golangci-lint-1.51.1-linux-arm64.tar.gz: 9744bc34e7b8d82ca788b667bfb7155a39b4be9aef43bf9f10318b1372cea338
+https://github.com/golangci/golangci-lint/releases/download/v1.51.1/golangci-lint-1.51.1-linux-armv6.tar.gz: 0dda8dbeb2ff7455a044ec8e347f2fc6d655d2e99d281b3b95e88167031c673d
+https://github.com/golangci/golangci-lint/releases/download/v1.51.1/golangci-lint-1.51.1-windows-amd64.zip: 722d7b87b9cdda0a3835d5030b3fc5385c2eba4c107f63f6391cfb2ac35f051d
 https://github.com/goreleaser/goreleaser/releases/download/v0.176.0/goreleaser_Darwin_arm64.tar.gz: 1f95e6561974f4766d8833438b646b06930563ca9867447ea03edb623d876c75
 https://github.com/goreleaser/goreleaser/releases/download/v0.176.0/goreleaser_Darwin_x86_64.tar.gz: 17ecad881a50e32f033da5a200c8417d37cae70f09e925645452937998aca506
 https://github.com/goreleaser/goreleaser/releases/download/v0.176.0/goreleaser_Linux_arm64.tar.gz: 8bf2a9b9e84498bfa239f2fe91b2d555642c87ab9d3f5d37f29e6e97116910a3
diff --git a/tools/tools.mk b/tools/tools.mk
index e2a2180a..346dbf94 100644
--- a/tools/tools.mk
+++ b/tools/tools.mk
@@ -102,7 +102,7 @@ retry:=
 endif
 
 # tool versions
-GOLANGCI_LINT_VERSION=1.50.1
+GOLANGCI_LINT_VERSION=1.51.1
 CHECKLOCKS_VERSION=release-20221026.0
 NODE_VERSION=16.13.0
 HUGO_VERSION=0.89.2


Test patch:
diff --git a/repo/ecc/ecc_rs_crc_test.go b/repo/ecc/ecc_rs_crc_test.go
index 92ca8a5c..2c639289 100644
--- a/repo/ecc/ecc_rs_crc_test.go
+++ b/repo/ecc/ecc_rs_crc_test.go
@@ -21,7 +21,7 @@ func Test_RsCrc32_AssertSizeAlwaysGrow(t *testing.T) {
 
 	for i := 1; i < 10*1024*1024; i++ {
 		sizes := impl.computeSizesFromOriginal(i)
-		total := sizes.computeFinalFileSize(i)
+		total := computeFinalFileSize(&sizes, i)
 
 		//nolint:gocritic
 		// println(fmt.Sprintf("%-8v -> b:%-4v s:%-8v t:%-8v", i, sizes.Blocks, sizes.ShardSize, total))
diff --git a/tests/end_to_end_test/server_start_test.go b/tests/end_to_end_test/server_start_test.go
index 74d272fb..63473bab 100644
--- a/tests/end_to_end_test/server_start_test.go
+++ b/tests/end_to_end_test/server_start_test.go
@@ -42,7 +42,7 @@ func TestServerStart(t *testing.T) {
 
 	var sp testutil.ServerParameters
 
-	e.RunAndProcessStderr(t, sp.ProcessOutput,
+	wait, _ := e.RunAndProcessStderr(t, sp.ProcessOutput,
 		"server", "start",
 		"--ui",
 		"--address=localhost:0",
@@ -54,6 +54,9 @@ func TestServerStart(t *testing.T) {
 		"--override-username=fake-username",
 		"--ui-title-prefix", "Blah: <script>bleh</script> ",
 	)
+
+	defer wait()
+
 	t.Logf("detected server parameters %#v", sp)
 
 	cli, err := apiclient.NewKopiaAPIClient(apiclient.Options{
@@ -196,7 +199,7 @@ func TestServerStartAsyncRepoConnect(t *testing.T) {
 	)
 
 	// run again - passing --async-repo-connect
-	e.RunAndProcessStderr(t, sp.ProcessOutput,
+	wait, _ := e.RunAndProcessStderr(t, sp.ProcessOutput,
 		"server", "start",
 		"--ui",
 		"--address=localhost:0",
@@ -206,6 +209,9 @@ func TestServerStartAsyncRepoConnect(t *testing.T) {
 		"--tls-generate-cert",
 		"--tls-generate-rsa-key-size=2048", // use shorter key size to speed up generation
 	)
+
+	defer wait()
+
 	t.Logf("detected server parameters %#v", sp)
 
 	controlClient, err := apiclient.NewKopiaAPIClient(apiclient.Options{
@@ -263,13 +269,16 @@ func TestServerCreateAndConnectViaAPI(t *testing.T) {
 		},
 	}
 
-	e.RunAndProcessStderr(t, sp.ProcessOutput,
+	wait, _ := e.RunAndProcessStderr(t, sp.ProcessOutput,
 		"server", "start", "--ui",
 		"--address=localhost:0", "--random-password",
 		"--random-server-control-password",
 		"--tls-generate-cert",
 		"--tls-generate-rsa-key-size=2048", // use shorter key size to speed up generation,
 	)
+
+	defer wait()
+
 	t.Logf("detected server parameters %#v", sp)
 
 	cli, err := apiclient.NewKopiaAPIClient(apiclient.Options{
@@ -345,12 +354,16 @@ func TestConnectToExistingRepositoryViaAPI(t *testing.T) {
 	}
 
 	// at this point repository is not connected, start the server
-	e.RunAndProcessStderr(t, sp.ProcessOutput, "server", "start",
+	wait, _ := e.RunAndProcessStderr(t, sp.ProcessOutput, "server", "start",
 		"--ui", "--address=localhost:0", "--random-password",
 		"--random-server-control-password",
 		"--tls-generate-cert",
 		"--tls-generate-rsa-key-size=2048", // use shorter key size to speed up generation
-		"--override-hostname=fake-hostname", "--override-username=fake-username")
+		"--override-hostname=fake-hostname", "--override-username=fake-username",
+	)
+
+	defer wait()
+
 	t.Logf("detected server parameters %#v", sp)
 
 	controlClient, err := apiclient.NewKopiaAPIClient(apiclient.Options{
@@ -428,7 +441,7 @@ func TestServerStartInsecure(t *testing.T) {
 	var sp testutil.ServerParameters
 
 	// server starts without password and no TLS when --insecure is provided.
-	e.RunAndProcessStderr(t, sp.ProcessOutput,
+	wait, _ := e.RunAndProcessStderr(t, sp.ProcessOutput,
 		"server", "start",
 		"--ui",
 		"--address=localhost:0",
@@ -436,6 +449,8 @@ func TestServerStartInsecure(t *testing.T) {
 		"--insecure",
 	)
 
+	defer wait()
+
 	cli, err := apiclient.NewKopiaAPIClient(apiclient.Options{
 		BaseURL: sp.BaseURL,
 	})