Repository: docker/compose
Pull request #12430 (2025-01-03 10:01:09)

build(deps): bump github.com/jonboulle/clockwork from 0.4.0 to 0.5.0
Bumps [github.com/jonboulle/clockwork](https://github.com/jonboulle/clockwork) from 0.4.0 to 0.5.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/jonboulle/clockwork/releases">github.com/jonboulle/clockwork's releases</a>.</em></p>
<blockquote>
<h2>v0.5.0</h2>
<!-- raw HTML omitted -->
<h2>What's Changed</h2>
<h3>Enhancements 🚀</h3>
<ul>
<li>Convert FakeClock to a struct. by <a href="https://github.com/DPJacques"><code>@​DPJacques</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/71">jonboulle/clockwork#71</a></li>
</ul>
<h3>Dependency Updates ⬆️</h3>
<ul>
<li>build(deps): bump actions/checkout from 3 to 4 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/73">jonboulle/clockwork#73</a></li>
<li>build(deps): bump actions/setup-go from 4 to 5 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/80">jonboulle/clockwork#80</a></li>
<li>build(deps): bump github/codeql-action from 2 to 3 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/81">jonboulle/clockwork#81</a></li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>Make NewTicker panic if d&lt;=0, like time.NewTicker. by <a href="https://github.com/DPJacques"><code>@​DPJacques</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/70">jonboulle/clockwork#70</a></li>
<li>Fix typos and grammar issue by <a href="https://github.com/alexandear"><code>@​alexandear</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/72">jonboulle/clockwork#72</a></li>
<li>Set minimal workflow permissions by <a href="https://github.com/pnacht"><code>@​pnacht</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/75">jonboulle/clockwork#75</a></li>
<li>Add security policy by <a href="https://github.com/pnacht"><code>@​pnacht</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/78">jonboulle/clockwork#78</a></li>
<li>add Until method on clock interface by <a href="https://github.com/WillMatthews"><code>@​WillMatthews</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/85">jonboulle/clockwork#85</a></li>
<li>Bump Go version to 1.21. by <a href="https://github.com/DPJacques"><code>@​DPJacques</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/89">jonboulle/clockwork#89</a></li>
<li>Remove some duplication &amp; use slices package. by <a href="https://github.com/DPJacques"><code>@​DPJacques</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/90">jonboulle/clockwork#90</a></li>
<li>Standardize tests for core clockwork functions. by <a href="https://github.com/DPJacques"><code>@​DPJacques</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/91">jonboulle/clockwork#91</a></li>
<li>Add contexts that use FakeClock rather than the system time. by <a href="https://github.com/DPJacques"><code>@​DPJacques</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/92">jonboulle/clockwork#92</a></li>
<li>Remove firer struct &amp; fix ticker reset by <a href="https://github.com/DPJacques"><code>@​DPJacques</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/95">jonboulle/clockwork#95</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/alexandear"><code>@​alexandear</code></a> made their first contribution in <a href="https://redirect.github.com/jonboulle/clockwork/pull/72">jonboulle/clockwork#72</a></li>
<li><a href="https://github.com/pnacht"><code>@​pnacht</code></a> made their first contribution in <a href="https://redirect.github.com/jonboulle/clockwork/pull/75">jonboulle/clockwork#75</a></li>
<li><a href="https://github.com/WillMatthews"><code>@​WillMatthews</code></a> made their first contribution in <a href="https://redirect.github.com/jonboulle/clockwork/pull/85">jonboulle/clockwork#85</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/jonboulle/clockwork/compare/v0.4.0...v0.5.0">https://github.com/jonboulle/clockwork/compare/v0.4.0...v0.5.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/jonboulle/clockwork/commit/6d8d032a18422c2e3ef651170a8a55012d1f704c"><code>6d8d032</code></a> Remove firer struct &amp; fix ticker reset (<a href="https://redirect.github.com/jonboulle/clockwork/issues/95">#95</a>)</li>
<li><a href="https://github.com/jonboulle/clockwork/commit/91d2c0adaca249481d9c61dd194383fa62d30826"><code>91d2c0a</code></a> Add contexts that use FakeClock rather than the system time. (<a href="https://redirect.github.com/jonboulle/clockwork/issues/92">#92</a>)</li>
<li><a href="https://github.com/jonboulle/clockwork/commit/7e524bd2b23863a60332249b53a095fc9370603a"><code>7e524bd</code></a> Standardize tests for core clockwork functions. (<a href="https://redirect.github.com/jonboulle/clockwork/issues/91">#91</a>)</li>
<li><a href="https://github.com/jonboulle/clockwork/commit/11a247d8fc82069355fd024bc08d4ad4366c0013"><code>11a247d</code></a> Remove some duplication &amp; use slices package. (<a href="https://redirect.github.com/jonboulle/clockwork/issues/90">#90</a>)</li>
<li><a href="https://github.com/jonboulle/clockwork/commit/fe91b0de93b9f79240e9f4ed093120db61f49ee7"><code>fe91b0d</code></a> Bump Go verison to 1.21.</li>
<li><a href="https://github.com/jonboulle/clockwork/commit/33fc064cceda86a937e85a0b01309974970c6a52"><code>33fc064</code></a> add Until method on clocks</li>
<li><a href="https://github.com/jonboulle/clockwork/commit/fc59783b0293939df2ade8872f0e8cfd87c9dbfe"><code>fc59783</code></a> build(deps): bump github/codeql-action from 2 to 3</li>
<li><a href="https://github.com/jonboulle/clockwork/commit/5c13cb81e3298b37d5623bda1034c01e324de26e"><code>5c13cb8</code></a> Merge pull request <a href="https://redirect.github.com/jonboulle/clockwork/issues/80">#80</a> from jonboulle/dependabot/github_actions/actions/setup...</li>
<li><a href="https://github.com/jonboulle/clockwork/commit/72da535d7ba42700d02c4976b2dc4fd95e716b1d"><code>72da535</code></a> Update documentaiton on interactions with context.</li>
<li><a href="https://github.com/jonboulle/clockwork/commit/5508bca6cc96e1dcbb467049b40ec773b64c5d77"><code>5508bca</code></a> build(deps): bump actions/setup-go from 4 to 5</li>
<li>Additional commits viewable in <a href="https://github.com/jonboulle/clockwork/compare/v0.4.0...v0.5.0">compare view</a></li>
</ul>
</details>
<br />


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

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (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 show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@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>

> **Note**
> Automatic rebases have been disabled on this pull request as it has been open for over 30 days.



Patch:
diff --git a/go.mod b/go.mod
index bba588989..b9bf07287 100644
--- a/go.mod
+++ b/go.mod
@@ -25,7 +25,7 @@ require (
 	github.com/google/go-cmp v0.6.0
 	github.com/hashicorp/go-multierror v1.1.1
 	github.com/hashicorp/go-version v1.7.0
-	github.com/jonboulle/clockwork v0.4.0
+	github.com/jonboulle/clockwork v0.5.0
 	github.com/mattn/go-shellwords v1.0.12
 	github.com/mitchellh/go-ps v1.0.0
 	github.com/mitchellh/mapstructure v1.5.0
diff --git a/go.sum b/go.sum
index cb198ed39..2d9e17c35 100644
--- a/go.sum
+++ b/go.sum
@@ -257,8 +257,8 @@ github.com/jinzhu/gorm v0.0.0-20170222002820-5409931a1bb8/go.mod h1:Vla75njaFJ8c
 github.com/jinzhu/inflection v0.0.0-20170102125226-1c35d901db3d h1:jRQLvyVGL+iVtDElaEIDdKwpPqUIZJfzkNLV34htpEc=
 github.com/jinzhu/inflection v0.0.0-20170102125226-1c35d901db3d/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
 github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
-github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4=
-github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc=
+github.com/jonboulle/clockwork v0.5.0 h1:Hyh9A8u51kptdkR+cqRpT1EebBwTn1oK9YfGYbdFz6I=
+github.com/jonboulle/clockwork v0.5.0/go.mod h1:3mZlmanh0g2NDKO5TWZVJAfofYk64M7XN3SzBPjZF60=
 github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
 github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
 github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=


Test patch:
diff --git a/pkg/compose/watch_test.go b/pkg/compose/watch_test.go
index d359a19fb..e123ecd21 100644
--- a/pkg/compose/watch_test.go
+++ b/pkg/compose/watch_test.go
@@ -147,7 +147,8 @@ func TestWatch_Sync(t *testing.T) {
 
 	watcher.Events() <- watch.NewFileEvent("/sync/changed")
 	watcher.Events() <- watch.NewFileEvent("/sync/changed/sub")
-	clock.BlockUntil(3)
+	err := clock.BlockUntilContext(ctx, 3)
+	assert.NilError(t, err)
 	clock.Advance(watch.QuietPeriod)
 	select {
 	case actual := <-syncer.synced:
@@ -161,7 +162,8 @@ func TestWatch_Sync(t *testing.T) {
 
 	watcher.Events() <- watch.NewFileEvent("/rebuild")
 	watcher.Events() <- watch.NewFileEvent("/sync/changed")
-	clock.BlockUntil(4)
+	err = clock.BlockUntilContext(ctx, 4)
+	assert.NilError(t, err)
 	clock.Advance(watch.QuietPeriod)
 	select {
 	case batch := <-syncer.synced:
diff --git a/pkg/watch/debounce_test.go b/pkg/watch/debounce_test.go
index 9571fd546..fd1c40bbf 100644
--- a/pkg/watch/debounce_test.go
+++ b/pkg/watch/debounce_test.go
@@ -40,7 +40,8 @@ func Test_BatchDebounceEvents(t *testing.T) {
 		ch <- FileEvent(path)
 	}
 	// we sent 100 events + the debouncer
-	clock.BlockUntil(101)
+	err := clock.BlockUntilContext(ctx, 101)
+	assert.NilError(t, err)
 	clock.Advance(QuietPeriod)
 	select {
 	case batch := <-eventBatchCh:
@@ -51,7 +52,8 @@ func Test_BatchDebounceEvents(t *testing.T) {
 	case <-time.After(50 * time.Millisecond):
 		t.Fatal("timed out waiting for events")
 	}
-	clock.BlockUntil(1)
+	err = clock.BlockUntilContext(ctx, 1)
+	assert.NilError(t, err)
 	clock.Advance(QuietPeriod)
 
 	// there should only be a single batch