如何重现Jest“网络错误"-本地浮动错误 [英] How to reproduce Jest “Network Error” - floating bug locally

查看:147
本文介绍了如何重现Jest“网络错误"-本地浮动错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我偶尔在管道上运行测试时,我会收到网络错误"消息.用于不同的文件(由于axios请求).虽然有时候我根本没有错误.

When I run tests on pipe lines occasionally I am getting "Network Error" for different files (because of axios requests). Though some times I don't get errors at all.

但是由于某种原因,无论我做什么,我都无法在本地得到该错误.我使用相同的节点版本v12.16.1.我试图将testTimeout减少到200(虽然有很多错误,但是有所不同).

But for some reason I can't get that error locally no matter what I do. I use same node version v12.16.1. I have tried to reduce testTimeout to 200 (I got bunch of errors but the were different).

  1. 所以问题是为什么该错误不一致?
  2. 如何使其一致并在本地复制?

推荐答案

问题是,尽管测试本身成功完成,但是一个测试没有正确完成请求.结果,带有请求的下一个测试失败.而且由于默认maxConcurrency: 5,几乎可以进行任何测试.

The problem was that one test didn't finished request properly, though test itself finished successfully. As the result next test with request failed. And because of default maxConcurrency: 5 that could be pretty any test.

尽管我仍然不清楚为什么无法在本地复制它.

Though why I was unable to reproduce it locally is still unclear for me.

这篇关于如何重现Jest“网络错误"-本地浮动错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆