Skip to content

Commit ce72d04

Browse files
committed
fixup: address review comment
fixup: address review comment
1 parent f732e6d commit ce72d04

File tree

2 files changed

+5
-58
lines changed

2 files changed

+5
-58
lines changed

test/experimental/test-http-abort-stream-end-als.js

Lines changed: 0 additions & 53 deletions
This file was deleted.

test/experimental/test-http-abort-stream-end-cls.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const assert = require('assert');
44

55
const http = require('http');
66
const { AsyncLocalStorage } = require('async_hooks');
7-
const als = new AsyncLocalStorage();
7+
const asyncLocalStorage = new AsyncLocalStorage();
88

99
const maxSize = 1024;
1010

@@ -19,10 +19,10 @@ const server = http.createServer(common.mustCall((req, res) => {
1919
}));
2020

2121
server.listen(0, () => {
22-
als.run(new Map(), common.mustCall(() => {
22+
asyncLocalStorage.run(new Map(), common.mustCall(() => {
2323
const options = { port: server.address().port };
2424
const req = http.get(options, common.mustCall((res) => {
25-
const store = als.getStore();
25+
const store = asyncLocalStorage.getStore();
2626
store.set('req', req);
2727
store.set('size', 0);
2828
res.on('data', ondata);
@@ -33,7 +33,7 @@ server.listen(0, () => {
3333
});
3434

3535
function ondata(d) {
36-
const store = als.getStore();
36+
const store = asyncLocalStorage.getStore();
3737
const req = store.get('req');
3838
let size = store.get('size');
3939
size += d.length;
@@ -47,7 +47,7 @@ function ondata(d) {
4747
}
4848

4949
function onabort() {
50-
const store = als.getStore();
50+
const store = asyncLocalStorage.getStore();
5151
const size = store.get('size');
5252
assert.strictEqual(size, maxSize);
5353
}

0 commit comments

Comments
 (0)