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 all 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
5 changes: 3 additions & 2 deletions test/upgrade.test.js
Expand Up @@ -174,8 +174,7 @@ test('Dueling upgrade and response handling 1', function(t) {
}

try {
var upg = res.claimUpgrade();
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.

res.claimUpgrade();
} catch (ex) {
done('expected requestUpgrade error');
}
Expand Down Expand Up @@ -205,6 +204,8 @@ test('Dueling upgrade and response handling 1', function(t) {
res.on('end', function() {
done('client response');
});
// noop data listener required for resume to take effect
res.on('data', function() {});
res.resume();
});
req.on('upgradeResult', function(err2, res) {
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