Skip to content

Commit 3580069

Browse files
fix: add mutex operations
1 parent 0698584 commit 3580069

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

agent/agenttest/client.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ func (*FakeAgentAPI) GetServiceBanner(context.Context, *agentproto.GetServiceBan
184184
}
185185

186186
func (f *FakeAgentAPI) GetTimings() []*agentproto.Timing {
187-
return f.timings
187+
f.Lock()
188+
defer f.Unlock()
189+
return slices.Clone(f.timings)
188190
}
189191

190192
func (f *FakeAgentAPI) SetAnnouncementBannersFunc(fn func() ([]codersdk.BannerConfig, error)) {

0 commit comments

Comments
 (0)