Skip to content

CI: Sporadic failures in example-start running multiple servers #657

@MikeMcC399

Description

@MikeMcC399

Description

.github/workflows/example-start.yml sometimes fails running jobs with multiple servers activated.

Although different jobs are failing, the log always shows the same information in the case of failure:

> example-start@1.0.0 start
> serve public

node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: EEXIST: file already exists, mkdir '/tmp/update-check'] {
  errno: -17,
  code: 'EEXIST',
  syscall: 'mkdir',
  path: '/tmp/update-check'
}

When a job with multiple servers succeeds, the log contains the following snippet, for example from job 6185404477:

> example-start@1.0.0 start2
> serve -p 8000 public


> example-start@1.0.0 start
> serve public

UPDATE AVAILABLE The latest version of `serve` is 14.1.2
UPDATE AVAILABLE The latest version of `serve` is 14.1.2
INFO: Accepting connections at http://localhost:8000
INFO: Accepting connections at http://localhost:3000

Bug history

View workflow logs via https://github.com/cypress-io/github-action/actions/workflows/example-start.yml?query=branch%3Amaster

Job Id Multiple
servers
Failures Failure job
start no no -
start-multiple yes yes 6019775968
start-multiple-commas yes yes 6185404872
start-v10 no no -
start-multiple-v10 yes yes 6151398085
start-multiple-commas-v10 yes yes 6056302589

The workflow has been failing on merges into the master branch on a regular basis since January 2022. Due to log retention policies only recent detailed logs going back 90 days are available. Job 4915627223 from September 14, 2022 is the earliest concrete evidence of the exact same failure.

Steps to reproduce the issue

Open a pull request to trigger a run of .github/workflows/example-start.yml

View the results on https://github.com/cypress-io/github-action/actions/workflows/example-start.yml

Expected behavior

All sub-tests of .github/workflows/example-start.yml should run reliably and succeed.

Analysis

The parallel tests make use of npm module serve 13.0.2, see:

and they invoke:

  • serve public
  • serve -p 8000 public

update-check is a dependency of and invoked by serve. update-check appears not to be thread safe and it seems that two instances of update-check collide when they attempt to create the directory /tmp/update-check.

There is an undocumented environment variable NO_UPDATE_CHECK which can be set to 1 to disable the update check. See PR vercel/serve#457.

Suggested Fix

  1. Disable update-check through environment variable NO_UPDATE_CHECK = 1.
  2. Update serve to the latest version (14.1.2). serve Version 14 requires a minimum of Node.js 14. This is compatible with GHA v5 which removes Node.js 12 support.

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