From 4622970cd1b5a6296fbb44eeeb9a2f69f3645ae1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Jan 2025 10:01:08 +0000 Subject: [PATCH 1/2] 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. - [Release notes](https://github.com/jonboulle/clockwork/releases) - [Commits](https://github.com/jonboulle/clockwork/compare/v0.4.0...v0.5.0) --- updated-dependencies: - dependency-name: github.com/jonboulle/clockwork dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index bba588989d..b9bf072876 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 cb198ed391..2d9e17c35c 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= From ed7f6922a1b840a91120c979a7dca59dcde21d65 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Mon, 10 Feb 2025 15:09:18 +0100 Subject: [PATCH 2/2] use BlockUntilContext Signed-off-by: Nicolas De Loof --- pkg/compose/watch_test.go | 6 ++++-- pkg/watch/debounce_test.go | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/compose/watch_test.go b/pkg/compose/watch_test.go index d359a19fb9..e123ecd217 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 9571fd5468..fd1c40bbf2 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