Skip to content

Commit 8da4bad

Browse files
TrottMyles Borins
authored and
Myles Borins
committed
test: fix pummel test failures
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 <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 6d9c0c9 commit 8da4bad

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

test/pummel/test-crypto-dh.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
2+
const common = require('../common');
3+
const assert = require('assert');
4+
const crypto = require('crypto');
45

5-
try {
6-
var crypto = require('crypto');
7-
} catch (e) {
6+
if (!common.hasCrypto) {
87
console.log('1..0 # Skipped: node compiled without OpenSSL.');
98
return;
109
}

test/pummel/test-dtrace-jsstack.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if (os.type() != 'SunOS') {
1414
var frames = [ 'stalloogle', 'bagnoogle', 'doogle' ];
1515

1616
var stalloogle = function(str) {
17-
expected = str;
17+
global.expected = str;
1818
os.loadavg();
1919
};
2020

test/pummel/test-net-throttle.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
4-
var net = require('net');
2+
const common = require('../common');
3+
const assert = require('assert');
4+
const net = require('net');
55

6-
var N = 1024 * 1024;
7-
var part_N = N / 3;
6+
const N = 1024 * 1024;
7+
const part_N = N / 3;
88
var chars_recved = 0;
99
var npauses = 0;
1010

1111
console.log('build big string');
12-
body = 'C'.repeat(N);
12+
const body = 'C'.repeat(N);
1313

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

0 commit comments

Comments
 (0)