Skip to content

Commit

Permalink
Remove goroutine datadir cleanup
Browse files Browse the repository at this point in the history
This is no longer required since we're cleaning up the datadir when we
call browser.close().
  • Loading branch information
ankur22 committed Aug 2, 2023
1 parent 595aeb7 commit bb18273
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions chromium/browser_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,20 +185,6 @@ func (b *BrowserType) launch(
}
flags["user-data-dir"] = dataDir.Dir

go func(c context.Context) {
defer func() {
if err := dataDir.Cleanup(); err != nil {
logger.Errorf("BrowserType:Launch", "cleaning up the user data directory: %v", err)
}
}()
// There's a small chance that this might be called
// if the context is closed by the k6 runtime. To
// guarantee the cleanup we would need to orchestrate
// it correctly which https://github.com/grafana/k6/issues/2432
// will enable once it's complete.
<-c.Done()
}(ctx)

browserProc, err := b.allocate(ctx, opts, flags, dataDir, logger)
if browserProc == nil {
return nil, 0, fmt.Errorf("launching browser: %w", err)
Expand Down

0 comments on commit bb18273

Please sign in to comment.