Lines Matching +full:require +full:- +full:common +full:- +full:first
2 // Flags: --expose-internals
3 const common = require('../common'); constant
4 const initHooks = require('./init-hooks');
5 const { checkInvocations } = require('./hook-checks');
6 const assert = require('assert');
7 const { async_id_symbol } = require('internal/async_hooks').symbols;
8 const http = require('http');
11 // is not reused. Test is based on parallel\test-async-hooks-http-agent.js.
37 res.on('data', common.mustCallAtLeast());
38 res.on('end', common.mustCall(() => {
47 const server = http.createServer(common.mustCall((req, res) => {
48 req.once('data', common.mustCallAtLeast(() => {
49 res.writeHead(200, { 'Content-Type': 'text/plain' });
52 req.on('end', common.mustCall(() => {
55 }, 2)).listen(0, common.mustCall(() => {
59 // First request.
62 }, common.mustCall(verifyRequest(0)));
65 // Second request. Sent in parallel with the first one.
68 }, common.mustCall(verifyRequest(1)));
81 const first = activities.filter((x) => x.uid === reqAsyncIds[0])[0];
82 checkInvocations(first, { init: 1, destroy: 1 }, 'when process exits');
88 assert.strictEqual(first.type, second.type);
89 assert.ok(first.handle !== second.handle, 'Resource reused');
90 assert.ok(first.handle === second.handle.handle,