Comments (17)
Confirmed, I've just ran into a similar issue with [email protected]
from expresso.
I get the following error when I have more than one assert.response test:
uncaught: Error: ECONNREFUSED, Connection refused
at Client._onConnect (net.js:548:18)
at IOWatcher.onWritable as callback
But I only run into that problem with node 0.3.6 (both expresso 0.7.0 and 0.7.2). On node 0.2.6 it runs fine with expresso 0.7.2
from expresso.
I'm having the same issue as well with node 0.4.0 and expresso 0.7.2.
from expresso.
confirmed its also seems to be a problem with expresso 0.7.2 and node 0.4.1
from expresso.
the same (ECONNREFUSED, Connection refused) is seen from two assert.response in the same test using the serial option with node 0.4.4 and expresso 0.7.5
from expresso.
I see this problem, using expresso 0.7.6.
I think the problem is that when you run tests with --serial, expresso closes the server after each test. When it re-opens it, it increments the port number. However it has cached the HTTP client in server.client
, and it doesn't clear this cache when closing the server. Changing the code (in the issue
function) at line 403 of the expresso file from
client = server.client,
to
client = http.createClient(server.__port),
seems to sort things out. (The earlier lines looking at the cached server.client
and updating it if it is empty can be removed.) Alternatively the cache can be cleared when the server is closed, but I'd prefer the solution with the fewest lines of code.
One other thing I noticed when investigating this - at line 478, the code
// Callback
callback(response);
check();
allows the next test to begin before the check()
call closes the server. Calling check()
before calling the callback gives stronger serialization of the tests.
from expresso.
(I'm assuming there was a good reason for incrementing the port number.)
from expresso.
they are run in parallel so you kinda have to
from expresso.
In production the application would need to handle many concurrent requests, but that doesn't mean it needs to listen on more than one port. Is there something I'm missing about the way the test drives the application?
Anyway, did my earlier comment make sense?
from expresso.
you can use assert.response() with more than one server in more than one test running parallel
from expresso.
OK, I see that different servers would need different ports. I'm not convinced that you need to change the port on an existing server when you close and re-open it.
from expresso.
nah, but nothing about expresso is polished lol only a rewrite will solve that
from expresso.
Perhaps a bit of tidying up. I shall read it a bit more, and read some of the other open issues. I think my comment above about needing a new client when you change the server port is the answer to this particular one.
from expresso.
it's super messy haha I started a rewrite but i dont have it up on github
from expresso.
This seems to still be happening with node 0.4.7 and express 2.3.4
from expresso.
Looks to me as if this is fixed now, in 0.7.7.
from expresso.
This is happening for me as well, but only about 75% of the time.
- Expres v2.4.0
- Expresso v0.7.9
from expresso.
Related Issues (20)
- Test name is lost when asserting from inside a callback HOT 2
- nested assert.response in node 0.6 HOT 4
- assert.length not working with node 0.6.0 HOT 2
- assert.response error inside another response call HOT 4
- assert.response. second request after response HOT 8
- Unable to install on Windows with node 0.6.7 HOT 11
- Failed to install in Windows XP node.js 0.6.10 HOT 1
- npm install errors on osx 10.7.3
- can't get coverage to show in expresso 0.9.2 and node 0.6.4 HOT 1
- trouble installing expresso via npm on joyent node smartmachine HOT 1
- Error: EROFS, symlink '../expresso/deps/jscoverage/node-jscoverage' HOT 3
- Can't run test HOT 1
- Making all in js fails HOT 2
- Add tags for releases HOT 2
- Search test directory recursively HOT 4
- expresso always hangs forever HOT 1
- npm install fails using node 0.10.29 HOT 4
- configure: error: cannot guess build type; on arm platform HOT 1
- should be deprecated on npm
- Matt
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from expresso.