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

Parallel testing causes multiple servers on the same port, resulting in jest hanging and failing unpredictably #1422

Open
MJGTwo opened this issue Sep 21, 2020 · 0 comments
Labels
type/bug Something is not working the way it should

Comments

@MJGTwo
Copy link

MJGTwo commented Sep 21, 2020

Nexus Report

{
  "node": "v12.4.0",
  "os": {
    "platform": "darwin",
    "release": "19.6.0"
  },
  "nexus": "^0.26.1",
  "plugins": [
    "nexus-plugin-prisma",
    "nexus-plugin-jwt-auth",
    "nexus-plugin-shield"
  ],
  "otherDependencies": {
    "bcryptjs": "^2.4.3",
    "body-parser": "^1.19.0",
    "cors": "^2.8.5",
    "dotenv-cli": "^4.0.0",
    "jest-config": "^26.4.2",
    "jsonwebtoken": "^8.5.1"
  },
  "devDependencies": {
    "@types/bcryptjs": "^2.4.2",
    "@types/jsonwebtoken": "^8.5.0",
    "@typescript-eslint/eslint-plugin": "^4.1.1",
    "@typescript-eslint/parser": "^4.1.1",
    "babel-polyfill": "^6.26.0",
    "eslint": "^7.9.0",
    "eslint-config-prettier": "^6.11.0",
    "eslint-plugin-prettier": "^3.1.4",
    "jest": "^26.4.2",
    "jest-environment-node": "^26.3.0",
    "mysql": "^2.18.1",
    "nanoid": "^3.1.12",
    "supertest": "^4.0.2",
    "ts-jest": "^26.3.0",
    "typescript": "^4.0.2",
    "util": "^0.12.3"
  },
  "hasAppModule": true,
  "packageManager": "yarn",
  "errorsWhileGatheringReport": {
    "gettingLayout": null,
    "gettingPluginManifests": null
  }
}

Screenshot

Screen Shot 2020-09-21 at 1 32 53 PM

Description

When multiple test suites are ran in parallel, multiple instances of the server are spun up for the same port. This causes suites to unpredictably fail due to hanging for more than than the allotted time by the jest configuration. When ran with --runInBand this issue disappears due to servers being spun up one at a time.

Repro

https://github.com/MJGTwo/nexus-prisma-template

@MJGTwo MJGTwo added the type/bug Something is not working the way it should label Sep 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something is not working the way it should
Projects
None yet
Development

No branches or pull requests

1 participant