Skip to content

Commit

Permalink
attempt to fix web test data race
Browse files Browse the repository at this point in the history
  • Loading branch information
Janelle Law committed Nov 28, 2023
1 parent a389903 commit 9e6a6a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/test/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -2165,6 +2165,7 @@ func (e *Environment) StartAgent(id string, token *corev1.BootstrapToken, pins [
var a agent.AgentInterface
mu := &sync.Mutex{}
agentCtx, cancel := context.WithCancel(options.ctx)
e.ctx = logger.WithAgentId(e.ctx, id)
go func() {
defer cancel()
mu.Lock()
Expand All @@ -2184,7 +2185,6 @@ func (e *Environment) StartAgent(id string, token *corev1.BootstrapToken, pins [
mu.Unlock()
return
}
e.ctx = logger.WithAgentId(e.ctx, id)
globalTestPlugins.LoadPlugins(e.ctx, pl, pluginmeta.ModeAgent)
agentListMu.Lock()
agentList[id] = cancel
Expand Down

0 comments on commit 9e6a6a5

Please sign in to comment.