Skip to content

Process profiler will sometimes error: Error: Expected DataContext to already have been set via setCtx #30670

Open
@ryanthemanuel

Description

Current behavior

When using the process profiler, occasionally we will see an error like:

  cypress:server:util:process_profiler error running process profiler: Error: Expected DataContext to already have been set via setCtx. If this is a testing context, make sure you are calling "setCtx" in a before hook, otherwise check the application flow.  at c (<embedded>:2590:129954) at Object.a (<embedded>:2793:86766) at <embedded>:2799:33131 at r (<embedded>:2799:33161) at a (<embedded>:2799:33526) at Ls (<embedded>:871:5294) at Function.Ai [as map] (<embedded>:871:40855) at c (<embedded>:871:68047) at yi (<embedded>:871:40055) at <embedded>:871:25750 at Bs (<embedded>:871:5476) at jn (<embedded>:871:25716) at Jo.value (<embedded>:871:69776) at jn (<embedded>:871:25707) at zo.toJSON.zo.valueOf.zo.value (<embedded>:871:70799) at a (<embedded>:2799:33603) at h (<embedded>:2799:33619)

It is somewhat inconsistently reproducible but seems to happen in CI mostly.

Desired behavior

No error should occur

Test code to reproduce

This project demonstrates it in the associated CircleCI job: https://github.com/cypress-io/rm-cypress-test

Running:

DEBUG=cypress*process_profiler npx cypress run --browser chrome

Cypress Version

Various

Node version

Various

Operating System

Various

Debug Logs

No response

Other

No response

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions