Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit bb18273

Browse files
committed
Remove goroutine datadir cleanup
This is no longer required since we're cleaning up the datadir when we call browser.close().
1 parent 595aeb7 commit bb18273

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

chromium/browser_type.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -185,20 +185,6 @@ func (b *BrowserType) launch(
185185
}
186186
flags["user-data-dir"] = dataDir.Dir
187187

188-
go func(c context.Context) {
189-
defer func() {
190-
if err := dataDir.Cleanup(); err != nil {
191-
logger.Errorf("BrowserType:Launch", "cleaning up the user data directory: %v", err)
192-
}
193-
}()
194-
// There's a small chance that this might be called
195-
// if the context is closed by the k6 runtime. To
196-
// guarantee the cleanup we would need to orchestrate
197-
// it correctly which https://github.com/grafana/k6/issues/2432
198-
// will enable once it's complete.
199-
<-c.Done()
200-
}(ctx)
201-
202188
browserProc, err := b.allocate(ctx, opts, flags, dataDir, logger)
203189
if browserProc == nil {
204190
return nil, 0, fmt.Errorf("launching browser: %w", err)

0 commit comments

Comments
 (0)