Skip to content

[Bug]: playwright._impl._api_types.Error: Must start tracing before stopping #1007

@j0hnpauljones

Description

@j0hnpauljones

Playwright version

1.15.3/1.16.0/1.16.1

Operating system

Linux

What browsers are you seeing the problem on?

Chromium

Other information

Python 3.9
ubuntu 20.04

What happened? / Describe the bug

In my project I use tracing. I create new context for each test and have separate trace for each test.
I run it with arguments (name='trace', snapshots='True') .

It works with playwright 1.13.1

Code snippet to reproduce your bug

No response

Relevant log output

smth/python3.9/site-packages/playwright/sync_api/_generated.py:11723: in stop
    self._sync("tracing.stop", self._impl_obj.stop(path=path))
smth/python3.9/site-packages/playwright/_impl/_sync_base.py:111: in _sync
    return task.result()
smth/python3.9/site-packages/playwright/_impl/_tracing.py:47: in stop
    await self._do_stop_chunk(path)
smth/python3.9/site-packages/playwright/_impl/_tracing.py:54: in _do_stop_chunk
    await self._channel.send(
smth/python3.9/site-packages/playwright/_impl/_connection.py:39: in send
    return await self.inner_send(method, params, False)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <playwright._impl._connection.Channel object at 0x7fa38cdd7670>
method = 'tracingStopChunk', params = {'save': True}, return_as_dict = False

    async def inner_send(
        self, method: str, params: Optional[Dict], return_as_dict: bool
    ) -> Any:
        if params is None:
            params = {}
        callback = self._connection._send_message_to_server(self._guid, method, params)
        if self._connection._error:
            error = self._connection._error
            self._connection._error = None
            raise error
        done, _ = await asyncio.wait(
            {
                self._connection._transport.on_error_future,
                callback.future,
            },
            return_when=asyncio.FIRST_COMPLETED,
        )
        if not callback.future.done():
            callback.future.cancel()
>       result = next(iter(done)).result()
E       playwright._impl._api_types.Error: Must start tracing before stopping

smth/python3.9/site-packages/playwright/_impl/_connection.py:63: Error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions