TestCafe - ошибка [ERR_HTTP_HEADERS_SENT]: невозможно установить заголовки после их отправки клиенту - PullRequest
0 голосов
/ 04 мая 2020

Начал получать Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client в случайных местах, используя TestCafe.

У меня есть модуль локального узла, который является оболочкой для createTestCafe() API. Модуль называется testcafe-runner и устанавливается следующим образом: "testcafe-runner": "file:local_modules/testcafe-runner".

Я начал получать сообщение об ошибке со следующим исключением:

Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
    at ServerResponse.setHeader (_http_outgoing.js:485:11)
    at RequestPipelineContext.redirect (C:\MyTests\local_modules\testcafe-runner\node_modules\testcafe-hammerhead\lib\request-pipeline\context.js:278:9)
    at TestRun.handlePageError (C:\MyTests\local_modules\testcafe-runner\node_modules\testcafe\src\test-run\index.js:287:13)
    at SessionController.handlePageError (C:\MyTests\local_modules\testcafe-runner\node_modules\testcafe\src\test-run\session-controller.js:43:36)
    at error (C:\MyTests\local_modules\testcafe-runner\node_modules\testcafe-hammerhead\lib\request-pipeline\utils.js:81:48)
    at DestinationRequest.<anonymous> (C:\MyTests\local_modules\testcafe-runner\node_modules\testcafe-hammerhead\lib\request-pipeline\utils.js:62:9)
    at DestinationRequest.emit (events.js:209:13)
    at DestinationRequest.EventEmitter.emit (domain.js:476:20)
    at DestinationRequest._onError (C:\MyTests\local_modules\testcafe-runner\node_modules\testcafe-hammerhead\lib\request-pipeline\destination-request\index.js:171:17)
    at ClientRequest.<anonymous> (C:\MyTests\local_modules\testcafe-runner\node_modules\testcafe-hammerhead\lib\request-pipeline\destination-request\index.js:93:40) {
  domainThrown: true
}
npm ERR! code ELIFECYCLE
npm ERR! errno 7

Все тестовые файлы javascript находятся в C: \ MyTests folder.

Версия testcafe 1.8.4, установленная как в local_module, так и в проекте

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...