1'use strict';
2const common = require('../common');
3const http = require('http');
4const assert = require('assert');
5
6// Checks that the setTimeout duration overflow warning is emitted
7// synchronously and therefore contains a meaningful stacktrace.
8
9process.on('warning', common.mustCall((warning) => {
10  assert(warning.stack.includes(__filename));
11}));
12
13const server = http.createServer((req, resp) => resp.end());
14server.listen(common.mustCall(() => {
15  http.request(`http://localhost:${server.address().port}`)
16    .setTimeout(2 ** 40)
17    .on('response', common.mustCall(() => {
18      server.close();
19    }))
20    .end();
21}));
22