Skip to content

[Bug]: Traces not cleaned up after successful tests when using retain-on-failure, causing disk space issues v2.0 #38433

@TiagoMAGarcia

Description

@TiagoMAGarcia

Version

1.56.1

Steps to reproduce

To reproduce you just need to activate the "retain-on-failure" trace option and run tests. We have 4 workers and 972 tests. Here's some screenshots of the drive when the pipeline is running our tests:

Before the pipeline run:
Image
10 minutes in:
Image
20 minutes in:
Image

Expected behavior

Traces for successful tests should be cleaned up immediately after each test completes successfully, rather than waiting until the end of the entire run. This would prevent disk space accumulation during long test runs.

Actual behavior

When using trace: 'retain-on-failure', traces for successful tests appear to only be cleaned up after the entire pipeline run completes. In our pipeline, this causes the dedicated drive to fill up during execution, leading to pipeline failures before all tests can complete.

Additional context

Related to: #38348

Environment

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 AMD Ryzen 7 9800X3D 8-Core Processor           
    Memory: 1.59 GB / 31.10 GB
  Binaries:
    Node: 22.19.0 - C:\nvm4w\nodejs\node.EXE
    npm: 11.5.2 - C:\nvm4w\nodejs\npm.CMD
  IDEs:
    VSCode: 1.99.0 - D:\Microsoft VS Code\bin\code.CMD
  npmPackages:
    @playwright/test: 1.56.1 => 1.56.1 
    playwright: 1.56.1 => 1.56.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions