Skip to content

[πŸ› Bug]: [py][build] Test errors when run with Bazel on Windows (long paths)Β #16390

@cgoldberg

Description

@cgoldberg

Description

Several Python tests fail when running with Bazel on Windows. They pass with Bazel on Linux, and also pass on Windows when run directly with pytest instead of Bazel. I get a cannot shorten the path enough error (see below).

This seems to be caused by how Bazel handles long paths on Windows: bazelbuild/bazel#22532

Reproducible Code

bazel test //py:common-chrome-bidi-test/selenium/webdriver/common/executing_async_javascript_tests.py

Debugging Logs

ERROR(tools/test/windows/tw.cc:1302) ERROR: src/main/native/windows/process.cc(95): WaitableProcess::Create(D:\_bazel\execroot\_main\bazel-out\x64_windows-fastbuild\bin\py\common-chrome-bidi-test\selenium\webdriver\common\executing_async_javascript_tests.py.exe.runfiles\_main\py\common-chrome-bidi-test\selenium\webdriver\common\executing_async_javascript_tests.py.exe): ERROR: src/main/native/windows/util.cc(292): AsExecutablePathForCreateProcess(D:\_bazel\execroot\_main\bazel-out\x64_windows-fastbuild\bin\py\common-chrome-bidi-test\selenium\webdriver\common\executing_async_javascript_tests.py.exe.runfiles\_main\py\common-chrome-bidi-test\selenium\webdriver\common\executing_async_javascript_tests.py.exe): ERROR: src/main/native/windows/util.cc(262): GetShortPathNameW(\\?\D:\_bazel\execroot\_main\bazel-out\x64_windows-fastbuild\bin\py\common-chrome-bidi-test\selenium\webdriver\common\executing_async_javascript_tests.py.exe.runfiles\_main\py\common-chrome-bidi-test\selenium\webdriver\common\executing_async_javascript_tests.py.exe): cannot shorten the path enough

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-buildIncludes scripting, bazel and CI integrationsC-pyPython BindingsI-defectSomething is not working as intendedOS-windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions