bahmutov / bahmutov/start-server-and-test

Timeout does not work resulting in ESOCKETTIMEDOUT using cypress

Open
#175 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.6k
Forks
97
Avg merge
8m
Merged PRs (30d)
8

Description

Hi,

I am using start-server-and-test (v1.9.1) in combination with cypress (v3.3.1), as described here: https://docs.cypress.io/guides/guides/continuous-integration.html#Solutions with the command
```start-server-and-test start http://localhost:3000 cypressRunChrome```

According to the description of the 5-Minute-Timeout utility, it should wait until the server is ready and responds. This seems not to work in my case, resulting in an ESOCKETTIMEDOUT error while running the tests. I the log file, I see that the dev server starts at 11:18:53, it is ready at 11:20:08, but the test are already starting at 11:19:14.

I am expecting that start-server-and-test start is waiting, but for some reasons, it does not.

Log snippet:
```
11:18:47 starting server using command "npm run start"
11:18:47 and when url "http://localhost:3000" is responding
11:18:47 running tests using command "npm run cypressRunChrome"
11:18:48
11:18:48 > App@0.1.0 start C:\...
11:18:48 > react-scripts start
11:18:48
11:18:53 Starting the development server...
11:18:58
11:18:58 > App@0.1.0 cypressRunChrome C:\...
11:18:58 > cypress run --browser chrome
11:19:14
11:19:14 ====================================================================================================
11:19:14
11:19:14 (Run Starting)
11:19:14
11:19:14 ┌────────────────────────────────────────────────────────────────────────────────────────────────┿
11:19:14 │ Cypress: 3.3.1 │
11:19:14 │ Browser: Chrome 71 │
11:19:14 │ Specs: 5 found (...) │
11:19:14 └────────────────────────────────────────────────────────────────────────────────────────────────┘
11:19:14
11:19:14 ────────────────────────────────────────────────────────────────────────────────────────────────────
11:19:14
11:19:14 Running: test.js... (1 of 5)
...
11:19:50 We attempted to make an http request to this URL but the request failed without a response.
11:19:50
11:19:50 We received this error at the network level:
11:19:50
11:19:50 > Error: ESOCKETTIMEDOUT
...
11:20:08 Compiled successfully!
11:20:08
11:20:08 You can now view App in the browser.
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with the documented start-server-and-test command, Cypress 3.3.1, and a server that takes time to compile. Read the 5-Minute-Timeout utility and the URL-wait path to determine why the test command starts before http://localhost:3000 responds. Done means the test command starts only after the URL responds and the ESOCKETTIMEDOUT failure no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
cypress, javascript
Domain
cli, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.