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

fix(test): make upgrade test pass #1772

Merged
merged 3 commits into from Apr 15, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions Makefile
Expand Up @@ -70,9 +70,5 @@ docs-build:
benchmark:
@(cd ./benchmark && $(NPM) i && $(NODE) index.js)

.PHONY: audit
audit:
@($(NPM) audit || true)

include ./tools/mk/Makefile.deps
include ./tools/mk/Makefile.targ
2 changes: 1 addition & 1 deletion test/server.test.js
Expand Up @@ -34,7 +34,7 @@ var FAST_CLIENT;
var SERVER;

if (SKIP_IP_V6) {
console.warning('IPv6 tests are skipped: No IPv6 network is available');
console.warn('IPv6 tests are skipped: No IPv6 network is available');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hekike 😂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is why Travis was skipping the rest of the tests. Not sure why this wouldn't cause an error code though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooups, VW

}

///--- Tests
Expand Down
8 changes: 2 additions & 6 deletions test/upgrade.test.js
Expand Up @@ -160,8 +160,7 @@ test('GET without upgrade headers', function(t) {

test('Dueling upgrade and response handling 1', function(t) {
var done = finish_latch(t, {
'expected requestUpgrade error': 1,
'client response': 1
'expected requestUpgrade error': 1
});

SERVER.get('/attach', function(req, res, next) {
Expand All @@ -175,6 +174,7 @@ test('Dueling upgrade and response handling 1', function(t) {

try {
var upg = res.claimUpgrade();
// TODO we never reach this destroy() call. do we still need it?
upg.socket.destroy();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was removed because the claimUpgrade() call is what throws, so this line is never executed.

} catch (ex) {
done('expected requestUpgrade error');
Expand Down Expand Up @@ -202,10 +202,6 @@ test('Dueling upgrade and response handling 1', function(t) {
t.ifError(err2);
}
t.equal(res.statusCode, 400);
res.on('end', function() {
done('client response');
});
res.resume();
});
req.on('upgradeResult', function(err2, res) {
done('server upgraded unexpectedly');
Expand Down
2 changes: 1 addition & 1 deletion tools/mk/Makefile.targ
Expand Up @@ -244,4 +244,4 @@ $(DOC_MEDIA_DIRS_BUILD):
test:

.PHONY: prepush
prepush: check test audit
prepush: check test