Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(browser): handle config.base (#4686) #4692

Merged
merged 4 commits into from
Jan 4, 2024

Commits on Jan 4, 2024

  1. chore(test/browser): extract runVitest helper

    This is in preparation for adding a new test file which will run the
    tests with config.base set to confirm the fix for vitest-dev#4686.
    mbland committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    3becd20 View commit details
    Browse the repository at this point in the history
  2. fix(browser): handle config.base (vitest-dev#4686)

    Ensures that every import() is properly prefixed with either config.base
    or '/'.
    mbland committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    29b4f66 View commit details
    Browse the repository at this point in the history
  3. fix(test/browser): set test-concurrency=1 (vitest-dev#4686)

    Adding the fix-4686.test.mjs introduced a second `vitest` process into
    the test/browser/specs suite. This attempts to resolve subsequent
    flakiness in the test-browser CI job by ensuring one test file
    completely finishes before the next.
    
    - https://nodejs.org/docs/latest-v20.x/api/cli.html#--test-concurrency
    
    ---
    
    This particular build showed ETXTBSY errors thrown when launching the
    chrome via WebdriverIO:
    
    - https://github.com/vitest-dev/vitest/actions/runs/7128065730/job/19409296285?pr=4692#step:10:1
    
    ```text
        ⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯
        Error: spawn ETXTBSY
         ❯ ChildProcess.spawn node:internal/child_process:421:11
         ❯ Object.spawn node:child_process:761:9
         ❯ startWebDriver ../../node_modules/.pnpm/@wdio[email protected]/node_modules/@wdio/utils/build/node/startWebDriver.js:57:28
         ❯ process.processTicksAndRejections node:internal/process/task_queues:95:5
         ❯ WebDriver.newSession ../../node_modules/.pnpm/[email protected]/node_modules/webdriver/build/index.js:18:31
         ❯ remote ../../node_modules/.pnpm/[email protected][email protected]/node_modules/webdriverio/build/index.js:45:22
         ❯ WebdriverBrowserProvider.openBrowser ../../packages/browser/dist/providers.js:81:26
         [...snip...]
    ```
    
    ETXTBSY is a relatively obscure error that isn't seen much anymore:
    
    - lwn.net: The shrinking role of ETXTBSY
      https://lwn.net/Articles/866493/
    
    The results I found while searching all seemed to point to Chromium
    being a potential source of this issue, such as this excerpt from (emphasis
    mine):
    
    - alixaxel/chrome-aws-lambda#69 (comment)
    
    ```text
    The `ETXTBSY` error code is thrown when puppeteer is trying to **start the
    Chromium binary but the binary file is under a exclusive lock** - that can
    happen if you don't wait for `executablePath` to resolve, or, **if you
    call `executablePath` multiple times.**
    ```
    
    This also showed up with older versions of Node and Docker, but each of
    the versions in the current build are up to date.
    mbland committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    c756441 View commit details
    Browse the repository at this point in the history
  4. refactor:cleanup

    Originally by @sheremet-va in commit
    f077ec4.
    
    Co-authored-by: Vladimir Sheremet <[email protected]>
    mbland and sheremet-va committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    f5f3251 View commit details
    Browse the repository at this point in the history