Skip to content

Commit

Permalink
test: add trailing commas in test/pummel
Browse files Browse the repository at this point in the history
PR-URL: #46610
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
  • Loading branch information
aduh95 authored and danielleadams committed Apr 3, 2023
1 parent 7eb1456 commit a2b103a
Show file tree
Hide file tree
Showing 36 changed files with 175 additions and 176 deletions.
1 change: 0 additions & 1 deletion test/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ overrides:
- es-module/*.mjs
- parallel/*.js
- parallel/*.mjs
- pummel/*.js
- sequential/*.js
- sequential/*.mjs
rules:
Expand Down
4 changes: 2 additions & 2 deletions test/pummel/test-crypto-timing-safe-equal-benchmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const T_THRESHOLD = 3.892;
const t = getTValue(crypto.timingSafeEqual);
assert(
Math.abs(t) < T_THRESHOLD,
`timingSafeEqual should not leak information from its execution time (t=${t})`
`timingSafeEqual should not leak information from its execution time (t=${t})`,
);

// As a coherence check to make sure the statistical tests are working, run the
Expand All @@ -118,5 +118,5 @@ const unsafeCompare = (bufA, bufB) => bufA.equals(bufB);
const t2 = getTValue(unsafeCompare);
assert(
Math.abs(t2) > T_THRESHOLD,
`Buffer#equals should leak information from its execution time (t=${t2})`
`Buffer#equals should leak information from its execution time (t=${t2})`,
);
2 changes: 1 addition & 1 deletion test/pummel/test-dh-regr.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ for (let i = 0; i < 2000; i++) {
bSecret,
'Secrets should be equal.\n' +
`aSecret: ${aSecret.toString('base64')}\n` +
`bSecret: ${bSecret.toString('base64')}`
`bSecret: ${bSecret.toString('base64')}`,
);
}
4 changes: 2 additions & 2 deletions test/pummel/test-fs-readfile-tostring-fail.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tmpdir.refresh();

const file = path.join(tmpdir.path, 'toobig.txt');
const stream = fs.createWriteStream(file, {
flags: 'a'
flags: 'a',
});

stream.on('error', (err) => { throw err; });
Expand All @@ -44,7 +44,7 @@ stream.on('finish', common.mustCall(function() {
message: 'Cannot create a string longer than ' +
`0x${stringLengthHex} characters`,
code: 'ERR_STRING_TOO_LONG',
name: 'Error'
name: 'Error',
})(err);
}
assert.strictEqual(buf, undefined);
Expand Down
4 changes: 2 additions & 2 deletions test/pummel/test-fs-watch-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fs.writeFileSync(filepathOne, 'hello');

assert.throws(
() => { fs.watchFile(filepathOne); },
{ code: 'ERR_INVALID_ARG_TYPE' }
{ code: 'ERR_INVALID_ARG_TYPE' },
);

// Does not throw.
Expand All @@ -78,7 +78,7 @@ fs.writeFileSync(filepathTwoAbs, 'howdy');

assert.throws(
() => { fs.watchFile(filepathTwo); },
{ code: 'ERR_INVALID_ARG_TYPE' }
{ code: 'ERR_INVALID_ARG_TYPE' },
);

{ // Does not throw.
Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-heapdump-dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ validateSnapshotNodes('Node / ChannelWrap', [
// `Node / ChannelWrap` (C++) -> `ChannelWrap` (JS)
{ node_name: 'ChannelWrap', edge_name: 'native_to_javascript' },
],
detachedness: 2
detachedness: 2,
},
]);
6 changes: 3 additions & 3 deletions test/pummel/test-heapdump-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ validateSnapshotNodes('Node / Environment', [{
{ node_name: 'Node / CleanupQueue', edge_name: 'cleanup_queue' },
{ node_name: 'Node / IsolateData', edge_name: 'isolate_data' },
{ node_name: 'Node / Realm', edge_name: 'principal_realm' },
]
],
}]);

validateSnapshotNodes('Node / CleanupQueue', [
Expand All @@ -28,14 +28,14 @@ validateSnapshotNodes('Node / CleanupQueue', [
{
children: [
{ node_name: 'Node / ContextifyScript' },
]
],
},
]);

validateSnapshotNodes('Node / Realm', [{
children: [
{ node_name: 'process', edge_name: 'process_object' },
]
],
}]);

console.log(context); // Make sure it's not GC'ed
2 changes: 1 addition & 1 deletion test/pummel/test-heapdump-fs-promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ validateSnapshotNodes('Node / FSReqPromise', [
children: [
{ node_name: 'FSReqPromise', edge_name: 'native_to_javascript' },
{ node_name: 'Float64Array', edge_name: 'stats_field_array' },
]
],
},
]);
14 changes: 7 additions & 7 deletions test/pummel/test-heapdump-http2.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ server.listen(0, () => {
children: [
// current_headers and/or queue could be empty
{ node_name: 'Http2Stream', edge_name: 'native_to_javascript' },
]
],
},
], { loose: true });

Expand All @@ -39,29 +39,29 @@ server.listen(0, () => {
children: [
{ node_name: 'FileHandle', edge_name: 'native_to_javascript' },
// current_headers could be empty
]
],
},
], { loose: true });
state.validateSnapshotNodes('Node / TCPSocketWrap', [
{
children: [
{ node_name: 'TCP', edge_name: 'native_to_javascript' },
]
],
},
], { loose: true });
state.validateSnapshotNodes('Node / TCPServerWrap', [
{
children: [
{ node_name: 'TCP', edge_name: 'native_to_javascript' },
]
],
},
], { loose: true });
// `Node / StreamPipe` (C++) -> StreamPipe (JS)
state.validateSnapshotNodes('Node / StreamPipe', [
{
children: [
{ node_name: 'StreamPipe', edge_name: 'native_to_javascript' },
]
],
},
]);
// `Node / Http2Session` (C++) -> Http2Session (JS)
Expand All @@ -71,11 +71,11 @@ server.listen(0, () => {
{ node_name: 'Http2Session', edge_name: 'native_to_javascript' },
{ node_name: 'Node / nghttp2_memory', edge_name: 'nghttp2_memory' },
{
node_name: 'Node / streams', edge_name: 'streams'
node_name: 'Node / streams', edge_name: 'streams',
},
// outstanding_pings, outgoing_buffers, outgoing_storage,
// pending_rst_streams could be empty
]
],
},
], { loose: true });
}));
Expand Down
4 changes: 2 additions & 2 deletions test/pummel/test-heapdump-inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const inspector = require('inspector');
const snapshotNode = {
children: [
{ node_name: 'Node / InspectorSession', edge_name: 'session' },
]
],
};

// Starts with no JSBindingsConnection (or 1 if coverage enabled).
Expand All @@ -34,7 +34,7 @@ const snapshotNode = {
(edge) => edge.name === 'callback' &&
(edge.to.type === undefined || // embedded graph
edge.to.type === 'closure'), // snapshot
]
],
},
];
if (process.env.NODE_V8_COVERAGE) {
Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-heapdump-tls.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const server = net.createServer(common.mustCall((c) => {
// `Node / TLSWrap` (C++) -> `TLSWrap` (JS)
{ node_name: 'TLSWrap', edge_name: 'native_to_javascript' },
// pending_cleartext_input could be empty
]
],
},
]);
}));
2 changes: 1 addition & 1 deletion test/pummel/test-heapdump-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ validateSnapshotNodes('Node / MessagePort', [
{
children: [
{ node_name: 'Node / MessagePortData', edge_name: 'data' },
]
],
},
], { loose: true });
worker.terminate();
4 changes: 2 additions & 2 deletions test/pummel/test-heapdump-zlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ validateSnapshotNodes('Node / ZlibStream', [
children: [
{ node_name: 'Zlib', edge_name: 'native_to_javascript' },
// No entry for memory because zlib memory is initialized lazily.
]
],
},
]);

Expand All @@ -22,7 +22,7 @@ gzip.write('hello world', common.mustCall(() => {
children: [
{ node_name: 'Zlib', edge_name: 'native_to_javascript' },
{ node_name: 'Node / zlib_memory', edge_name: 'zlib_memory' },
]
],
},
]);
}));
4 changes: 2 additions & 2 deletions test/pummel/test-heapsnapshot-near-heap-limit-big.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const fixtures = require('../common/fixtures');
const fs = require('fs');
const env = {
...process.env,
NODE_DEBUG_NATIVE: 'diagnostics'
NODE_DEBUG_NATIVE: 'diagnostics',
};

if (!common.enoughTestMem)
Expand All @@ -26,7 +26,7 @@ if (!common.enoughTestMem)
env: {
...env,
TEST_CHUNK: 2000,
}
},
});
const stderr = child.stderr.toString();
console.log(stderr);
Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-heapsnapshot-near-heap-limit-bounded.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const env = {
TEST_ALLOCATION: 50000,
TEST_CHUNK: 1000,
TEST_CLEAN_INTERVAL: 500,
NODE_DEBUG_NATIVE: 'diagnostics'
NODE_DEBUG_NATIVE: 'diagnostics',
};

{
Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-heapsnapshot-near-heap-limit-by-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const env = {
env: {
...env,
limit: 1,
limit2: 2
limit2: 2,
},
});
console.log(child.stdout.toString());
Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-heapsnapshot-near-heap-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const fixtures = require('../common/fixtures');
const fs = require('fs');
const env = {
...process.env,
NODE_DEBUG_NATIVE: 'diagnostics'
NODE_DEBUG_NATIVE: 'diagnostics',
};

{
Expand Down
4 changes: 2 additions & 2 deletions test/pummel/test-http-many-keep-alive-connections.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ server.listen(0, function connect() {
port: server.address().port,
path: '/',
headers: {
'Connection': 'Keep-alive'
}
'Connection': 'Keep-alive',
},
}, function(res) {
res.on('end', function() {
if (++responses < expected) {
Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-http-upload-timeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ server.listen(0, function() {
const request = http.request({
port: server.address().port,
method: 'POST',
path: '/'
path: '/',
});

function ping() {
Expand Down
4 changes: 2 additions & 2 deletions test/pummel/test-https-large-response.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const https = require('https');

const options = {
key: fixtures.readKey('agent1-key.pem'),
cert: fixtures.readKey('agent1-cert.pem')
cert: fixtures.readKey('agent1-cert.pem'),
};

process.stdout.write('build body...');
Expand All @@ -46,7 +46,7 @@ const server = https.createServer(options, common.mustCall(function(req, res) {
server.listen(0, common.mustCall(function() {
https.get({
port: server.address().port,
rejectUnauthorized: false
rejectUnauthorized: false,
}, common.mustCall(function(res) {
console.log('response!');

Expand Down
4 changes: 2 additions & 2 deletions test/pummel/test-https-no-reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const fixtures = require('../common/fixtures');

const options = {
key: fixtures.readKey('rsa_private.pem'),
cert: fixtures.readKey('rsa_cert.crt')
cert: fixtures.readKey('rsa_cert.crt'),
};

const buf = Buffer.allocUnsafe(1024 * 1024);
Expand All @@ -47,7 +47,7 @@ server.listen(0, function() {
const req = https.request({
method: 'POST',
port: server.address().port,
rejectUnauthorized: false
rejectUnauthorized: false,
}, function(res) {
res.read(0);

Expand Down
8 changes: 4 additions & 4 deletions test/pummel/test-keep-alive.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const body = 'hello world\n';
const server = http.createServer((req, res) => {
res.writeHead(200, {
'Content-Length': body.length,
'Content-Type': 'text/plain'
'Content-Type': 'text/plain',
});
res.write(body);
res.end();
Expand Down Expand Up @@ -108,17 +108,17 @@ process.on('exit', () => {
assert.strictEqual(
normalReqSec > 50,
true,
`normalReqSec should be greater than 50, but got ${normalReqSec}`
`normalReqSec should be greater than 50, but got ${normalReqSec}`,
);
assert.strictEqual(
keepAliveReqSec > 50,
true,
`keepAliveReqSec should be greater than 50, but got ${keepAliveReqSec}`
`keepAliveReqSec should be greater than 50, but got ${keepAliveReqSec}`,
);
assert.strictEqual(
normalReqSec < keepAliveReqSec,
true,
'normalReqSec should be less than keepAliveReqSec, ' +
`but ${normalReqSec} is greater than ${keepAliveReqSec}`
`but ${normalReqSec} is greater than ${keepAliveReqSec}`,
);
});
2 changes: 1 addition & 1 deletion test/pummel/test-net-throttle.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const server = net.createServer((connection) => {
assert.ok(connection.bufferSize >= 0, `bufferSize: ${connection.bufferSize}`);
assert.ok(
connection.writableLength <= totalLength,
`writableLength: ${connection.writableLength}, totalLength: ${totalLength}`
`writableLength: ${connection.writableLength}, totalLength: ${totalLength}`,
);
connection.end();
});
Expand Down
Loading

0 comments on commit a2b103a

Please sign in to comment.