Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] timeout doesn't call end with error #817

Open
3 tasks done
pbatey opened this issue Feb 17, 2023 · 0 comments
Open
3 tasks done

[fix] timeout doesn't call end with error #817

pbatey opened this issue Feb 17, 2023 · 0 comments
Labels

Comments

@pbatey
Copy link

pbatey commented Feb 17, 2023

Describe the bug

Node.js version: v18.14.1

OS version: macOS Ventura 13.1

Description: A request to a non-responsive route never times-out

Actual behavior

The function passed to request(app).timeout(ms).end(fn) is never called.

Expected behavior

I expected fn to be called with a timeout error.

Code to reproduce

This never exits.

const request = require('supertest');
const assert = require('assert');
const express = require('express');

const app = express();

app.get('/user', function(req, res) {
  // res.status(200).json({ name: 'john' });
});

request(app)
  .get('/user')
  .timeout({response: 100, deadline: 100})
  .end(function(err, res) {
    if (err) throw err;
  });

Checklist

  • I have searched through GitHub issues for similar issues.
  • I have completely read through the README and documentation.
  • I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.
@pbatey pbatey added the bug label Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant