function test (file) { file = join('fixtures', 'broken-pipe', file) t.test(file, { parallel: true }, async ({ is }) => { const child = fork(join(__dirname, file), { silent: true }) child.stdout.destroy() child.stderr.pipe(process.stdout) const res = await once(child, 'close') is(res, 0) // process exits successfully }) }
async getWatchObjectStream (options) { const watch = new this.client.Watch(this.kubeconfig) const stream = new Readable({ objectMode: true, read: () => { /* .watch callback pushes to stream below */ }, destroy: (err, cb) => { req.destroy(err) req.abort() cb(err) } }) const req = watch.watch( options.pathname, Object.assign({}, options.qs, options.parameters), (type, object) => stream.push({ type, object }), err => stream.destroy(err) ) return stream }
me._request.destroy(); } else if (me._request) { isCallDestroy = true;
cp.stderr.destroy();