Skip to content

[Bug]: Error running Playwright test in Windows runner in GitHub actions[Bug]:  #2506

Closed
@pamelafox

Description

@pamelafox

Version

1.45.1

Steps to reproduce

See the CI here:
https://github.com/Azure-Samples/rag-postgres-openai-python/actions/runs/10189786904/job/28188453780?pr=66

Here's the workflow file:
https://github.com/Azure-Samples/rag-postgres-openai-python/actions/runs/10189786904/workflow?pr=66

The playwright tests run fine in Mac, but they fail in the Windows runner.

We'll go ahead and disable them in main, but you can replicate by using our code at that point in time in a fork:
commit 0cf5e354b0e8e9723920887b769d8649730baa25 in https://github.com/john0isaac/rag-postgres-openai-python/tree/add-playwright-tests

Expected behavior

We expect tests to pass.

Actual behavior

We see this error:

____________________ ERROR at setup of test_home[chromium] ____________________

launch_browser = <function launch_browser.<locals>.launch at 0x0000016AF7510670>

    @pytest.fixture(scope="session")
    def browser(launch_browser: Callable[[], Browser]) -> Generator[Browser, None, None]:
>       browser = launch_browser()

C:\hostedtoolcache\windows\Python\3.10.11\x[64](https://github.com/Azure-Samples/rag-postgres-openai-python/actions/runs/10189786904/job/28188453780?pr=66#step:16:65)\lib\site-packages\pytest_playwright\pytest_playwright.py:2[66](https://github.com/Azure-Samples/rag-postgres-openai-python/actions/runs/10189786904/job/28188453780?pr=66#step:16:67): 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\pytest_playwright\pytest_playwright.py:258: in launch
    browser = browser_type.launch(**launch_options)
C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\playwright\sync_api\_generated.py:14155: in launch
    self._sync(
C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\playwright\_impl\_browser_type.py:94: in launch
    Browser, from_channel(await self._channel.send("launch", params))
C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\playwright\_impl\_connection.py:59: in send
    return await self._connection.wrap_api_call(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <playwright._impl._connection.Connection object at 0x0000016AF[72](https://github.com/Azure-Samples/rag-postgres-openai-python/actions/runs/10189786904/job/28188453780?pr=66#step:16:73)B8610>
cb = <function Channel.send.<locals>.<lambda> at 0x0000016AF[73](https://github.com/Azure-Samples/rag-postgres-openai-python/actions/runs/10189786904/job/28188453780?pr=66#step:16:74)8E8C0>
is_internal = False

    async def wrap_api_call(
        self, cb: Callable[[], Any], is_internal: bool = False
    ) -> Any:
        if self._api_zone.get():
            return await cb()
        task = asyncio.current_task(self._loop)
        st: List[inspect.FrameInfo] = getattr(task, "__pw_stack__", inspect.stack())
        parsed_st = _extract_stack_trace_information_from_stack(st, is_internal)
        self._api_zone.set(parsed_st)
        try:
            return await cb()
        except Exception as error:
>           raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None
E           playwright._impl._errors.Error: BrowserType.launch: ENOENT: no such file or directory, mkdtemp 'undefined\temp\playwright-artifacts-XXXXXXXXXXXX'

C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\playwright\_impl\_connection.py:514: Error

Additional context

No response

Environment

- Operating System: Windows
- CPU: Whatever is used by GitHub windows runner
- Browser: Chromium
- Python Version: 3.10 - 3.12
- Other info:

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