--server-wait is needed if running dredd multiple times
See original GitHub issueSteps to reproduce
- Run dredd. Everything works properly.
- When first run finishes, press arrow up in your terminal and run dredd again.
- Tests will not fail, but they start with strange error message.
$ dredd --hookfiles *-hook.*
Configuration dredd.yml found, ignoring other arguments.
Starting server with command: npm start
Waiting 3 seconds for server command to start...
> plutonium@0.0.1 start /Users/honzajavorek/Workspace/plutonium
> node ./bin/server
Error: listen EADDRINUSE
at errnoException (net.js:905:11)
at Server._listen2 (net.js:1043:14)
at listen (net.js:1065:10)
at Server.listen (net.js:1139:5)
at Server.listen (/Users/honzajavorek/Workspace/plutonium/node_modules/restify/lib/server.js:398:32)
at Object.<anonymous> (/Users/honzajavorek/Workspace/plutonium/bin/server:6:8)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
npm ERR! Darwin 14.5.0
npm ERR! argv "node" "/Users/honzajavorek/.nvm/v0.10.39/bin/npm" "start"
npm ERR! node v0.10.39
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! plutonium@0.0.1 start: `node ./bin/server`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the plutonium@0.0.1 start script 'node ./bin/server'.
npm ERR! This is most likely a problem with the plutonium package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./bin/server
npm ERR! You can get their info via:
npm ERR! npm owner ls plutonium
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/honzajavorek/Workspace/plutonium/npm-debug.log
info: Beginning Dredd testing...
...
Expected behavior
There should be no error messages during start of tests.
Workaround
If --server-wait
without value is added, it gives no errors. I do not understand why.
$ dredd --hookfiles *-hook.* --server-wait
Configuration dredd.yml found, ignoring other arguments.
Starting server with command: npm start
Waiting NaN seconds for server command to start...
info: Beginning Dredd testing...
...
The same behavior was reported also by @JackuB.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Command-line Interface — Dredd latest documentation
If you use Dredd repeatedly within a single project, the preferred way to run it is to first persist your configuration in a...
Read more >Dredd: Do Your HTTP API Justice
x and using those descriptions to power contract testing in your existing test suite is a far more useful and less painful way...
Read more >Writing and testing API specifications with API Blueprint ...
At the same time having a visual of the product gives the client this ... Remember, the advantage of using dredd and API...
Read more >Error with dredd hooks on Windows - Stack Overflow
As of now, Dredd is not officially supported on Windows. However, it should install and should work well as far as you don't...
Read more >Quick Start Guide with Github Actions - Pactflow Documentation
If you want to get hands-on and learn about Bi-Directional Contract testing, ... the API using an API testing tool such as ReadyAPI,SoapUI,RestAssured,Dredd...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Might be related. That would point to a bug in Dredd’s process-killing mechanics, because as far as I remember, Dredd should aim for killing the whole subprocess tree and making sure nothing survives.
(Hmm, that sentence sounds a lot like something from the Dredd universe 🤔 😅 💥 )
I don’t work on Dredd anymore, unfortunately, but the code responsible for terminating children starts on this line:
https://github.com/apiaryio/dredd/blob/b191dc0d665db441c216b84042b3b3677aba6d3e/packages/dredd/lib/childProcess.js#L60
To solve this problem, one would need to reproduce the issue locally and then go through this code and find flaws in tracking down and killing all related processes. The tests are here:
https://github.com/apiaryio/dredd/blob/b191dc0d665db441c216b84042b3b3677aba6d3e/packages/dredd/test/integration/childProcess-test.js#L61