Skip to content

Commit

Permalink
test: fix pummel test failures
Browse files Browse the repository at this point in the history
A handful of tests in `test/pummel` were failing due to undefined
variables.

The tests in pummel are not run in CI or otherwise exercised regularly
so these failures can go unnoticed for a long time.

PR-URL: #6012
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
Trott committed Apr 4, 2016
1 parent c60faf6 commit 263222d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions test/pummel/test-crypto-dh.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';
var common = require('../common');
var assert = require('assert');
const common = require('../common');
const assert = require('assert');
const crypto = require('crypto');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: node compiled without OpenSSL.');
Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-dtrace-jsstack.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (os.type() != 'SunOS') {
var frames = [ 'stalloogle', 'bagnoogle', 'doogle' ];

var stalloogle = function(str) {
expected = str;
global.expected = str;

This comment has been minimized.

Copy link
@Fishrock123

Fishrock123 Jul 1, 2016

Contributor

@Trott Did the lint not catch this...?

This comment has been minimized.

Copy link
@Trott

Trott Jul 1, 2016

Author Member

The rule that would have caught this is no-undef. While that was enabled everywhere else, it was disabled on the test files until about two weeks after this landed. (The rule was enabled for tests in 4faaed6.) It is probable that my motivation for fixing the undefined variables in this commit was to enable that lint rule in the first place.

Looking at this now, it appears that global.expected is an unused variable and can be removed. (I don't have DTRACE support on my machine so I can't easily confirm.)

os.loadavg();
};

Expand Down
12 changes: 6 additions & 6 deletions test/pummel/test-net-throttle.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var net = require('net');
const common = require('../common');
const assert = require('assert');
const net = require('net');

var N = 1024 * 1024;
var part_N = N / 3;
const N = 1024 * 1024;
const part_N = N / 3;
var chars_recved = 0;
var npauses = 0;

console.log('build big string');
body = 'C'.repeat(N);
const body = 'C'.repeat(N);

console.log('start server on port ' + common.PORT);

Expand Down

0 comments on commit 263222d

Please sign in to comment.