Skip to content

Commit a056cb6

Browse files
stirbyspikecurtisdependabot[bot]
authored
chore: add last commit from cherry-pick list for release (#19679)
Co-authored-by: Spike Curtis <spike@coder.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 0a73f84 commit a056cb6

File tree

4 files changed

+24
-21
lines changed

4 files changed

+24
-21
lines changed

coderd/metricscache/metricscache_test.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -261,20 +261,19 @@ func TestCache_BuildTime(t *testing.T) {
261261
wantTransition := codersdk.WorkspaceTransition(tt.args.transition)
262262
require.Eventuallyf(t, func() bool {
263263
stats := cache.TemplateBuildTimeStats(template.ID)
264-
return stats[wantTransition] != codersdk.TransitionStats{}
264+
ts := stats[wantTransition]
265+
return ts.P50 != nil && *ts.P50 == tt.want.buildTimeMs
265266
}, testutil.WaitLong, testutil.IntervalMedium,
266-
"BuildTime never populated",
267+
"P50 never reached expected value for %v", wantTransition,
267268
)
268269

269-
gotStats = cache.TemplateBuildTimeStats(template.ID)
270-
for transition, stats := range gotStats {
270+
gotStats := cache.TemplateBuildTimeStats(template.ID)
271+
for transition, ts := range gotStats {
271272
if transition == wantTransition {
272-
require.Equal(t, tt.want.buildTimeMs, *stats.P50)
273-
} else {
274-
require.Empty(
275-
t, stats, "%v", transition,
276-
)
273+
// Checked above
274+
continue
277275
}
276+
require.Empty(t, ts, "%v", transition)
278277
}
279278
} else {
280279
var stats codersdk.TemplateBuildTimeStats

coderd/prometheusmetrics/aggregator_test.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,19 @@ func verifyCollectedMetrics(t *testing.T, expected []*agentproto.Stats_Metric, a
194194

195195
var d dto.Metric
196196
err := actual[i].Write(&d)
197-
require.NoError(t, err)
197+
assert.NoError(t, err)
198198

199199
switch e.Type {
200200
case agentproto.Stats_Metric_COUNTER:
201-
require.Equal(t, e.Value, d.Counter.GetValue())
201+
if e.Value != d.Counter.GetValue() {
202+
return false
203+
}
202204
case agentproto.Stats_Metric_GAUGE:
203-
require.Equal(t, e.Value, d.Gauge.GetValue())
205+
if e.Value != d.Gauge.GetValue() {
206+
return false
207+
}
204208
default:
205-
require.Failf(t, "unsupported type: %s", string(e.Type))
209+
assert.Failf(t, "unsupported type: %s", string(e.Type))
206210
}
207211

208212
expectedLabels := make([]*agentproto.Stats_Metric_Label, len(e.Labels))
@@ -215,7 +219,7 @@ func verifyCollectedMetrics(t *testing.T, expected []*agentproto.Stats_Metric, a
215219
}
216220
sort.Slice(expectedLabels, sortFn)
217221
sort.Slice(dtoLabels, sortFn)
218-
require.Equal(t, expectedLabels, dtoLabels, d.String())
222+
assert.Equal(t, expectedLabels, dtoLabels, d.String())
219223
}
220224
return true
221225
}
@@ -229,7 +233,7 @@ func prometheusMetricToString(t *testing.T, m prometheus.Metric) string {
229233

230234
var d dto.Metric
231235
err := m.Write(&d)
232-
require.NoError(t, err)
236+
assert.NoError(t, err)
233237
dtoLabels := asMetricAgentLabels(d.GetLabel())
234238
sort.Slice(dtoLabels, func(i, j int) bool {
235239
return dtoLabels[i].Name < dtoLabels[j].Name

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ replace github.com/tcnksm/go-httpstat => github.com/coder/go-httpstat v0.0.0-202
3636

3737
// There are a few minor changes we make to Tailscale that we're slowly upstreaming. Compare here:
3838
// https://github.com/tailscale/tailscale/compare/main...coder:tailscale:main
39-
replace tailscale.com => github.com/coder/tailscale v1.1.1-0.20250729141742-067f1e5d9716
39+
replace tailscale.com => github.com/coder/tailscale v1.1.1-0.20250829055706-6eafe0f9199e
4040

4141
// This is replaced to include
4242
// 1. a fix for a data race: c.f. https://github.com/tailscale/wireguard-go/pull/25
@@ -175,7 +175,7 @@ require (
175175
github.com/spf13/afero v1.14.0
176176
github.com/spf13/pflag v1.0.7
177177
github.com/sqlc-dev/pqtype v0.3.0
178-
github.com/stretchr/testify v1.11.0
178+
github.com/stretchr/testify v1.11.1
179179
github.com/swaggo/http-swagger/v2 v2.0.1
180180
github.com/swaggo/swag v1.16.2
181181
github.com/tidwall/gjson v1.18.0

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -934,8 +934,8 @@ github.com/coder/serpent v0.10.0 h1:ofVk9FJXSek+SmL3yVE3GoArP83M+1tX+H7S4t8BSuM=
934934
github.com/coder/serpent v0.10.0/go.mod h1:cZFW6/fP+kE9nd/oRkEHJpG6sXCtQ+AX7WMMEHv0Y3Q=
935935
github.com/coder/ssh v0.0.0-20231128192721-70855dedb788 h1:YoUSJ19E8AtuUFVYBpXuOD6a/zVP3rcxezNsoDseTUw=
936936
github.com/coder/ssh v0.0.0-20231128192721-70855dedb788/go.mod h1:aGQbuCLyhRLMzZF067xc84Lh7JDs1FKwCmF1Crl9dxQ=
937-
github.com/coder/tailscale v1.1.1-0.20250729141742-067f1e5d9716 h1:hi7o0sA+RPBq8Rvvz+hNrC/OTL2897OKREMIRIuQeTs=
938-
github.com/coder/tailscale v1.1.1-0.20250729141742-067f1e5d9716/go.mod h1:l7ml5uu7lFh5hY28lGYM4b/oFSmuPHYX6uk4RAu23Lc=
937+
github.com/coder/tailscale v1.1.1-0.20250829055706-6eafe0f9199e h1:9RKGKzGLHtTvVBQublzDGtCtal3cXP13diCHoAIGPeI=
938+
github.com/coder/tailscale v1.1.1-0.20250829055706-6eafe0f9199e/go.mod h1:jU9T1vEs+DOs8NtGp1F2PT0/TOGVwtg/JCCKYRgvMOs=
939939
github.com/coder/terraform-config-inspect v0.0.0-20250107175719-6d06d90c630e h1:JNLPDi2P73laR1oAclY6jWzAbucf70ASAvf5mh2cME0=
940940
github.com/coder/terraform-config-inspect v0.0.0-20250107175719-6d06d90c630e/go.mod h1:Gz/z9Hbn+4KSp8A2FBtNszfLSdT2Tn/uAKGuVqqWmDI=
941941
github.com/coder/terraform-provider-coder/v2 v2.10.0 h1:cGPMfARGHKb80kZsbDX/t/YKwMOwI5zkIyVCQziHR2M=
@@ -1778,8 +1778,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
17781778
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
17791779
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
17801780
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
1781-
github.com/stretchr/testify v1.11.0 h1:ib4sjIrwZKxE5u/Japgo/7SJV3PvgjGiRNAvTVGqQl8=
1782-
github.com/stretchr/testify v1.11.0/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
1781+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
1782+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
17831783
github.com/swaggest/assertjson v1.9.0 h1:dKu0BfJkIxv/xe//mkCrK5yZbs79jL7OVf9Ija7o2xQ=
17841784
github.com/swaggest/assertjson v1.9.0/go.mod h1:b+ZKX2VRiUjxfUIal0HDN85W0nHPAYUbYH5WkkSsFsU=
17851785
github.com/swaggo/files/v2 v2.0.0 h1:hmAt8Dkynw7Ssz46F6pn8ok6YmGZqHSVLZ+HQM7i0kw=

0 commit comments

Comments
 (0)