为什么我和同学在 postman 使用同样的 API 测试却有不同的结果?

查看 13|回复 0
作者:Fffys   
  • express 搭建后端,API 测试各种 HTTP 方法都包含了,我们没有同时测试,但是同学所有的 API 调用都返回了 200 我却有一部分得到 409 有一部分 504 还有一个 401 未授权,以及同学完成所有测试只用了 22s 我却用了 4 分钟,有人可以解释一下原因吗?我们都完全不知道要怎么 debug……
  • 同学猜测可能是我网慢,但是网慢会造成每次都是同样的 API 出问题吗?出问题的 API 有的只涉及一个数据的修改而已……

    504 的错误(都是 timeout ):
    Status code | AssertionError: expected response to have status reason 'OK' but got 'CONNECTION TIMED OUT'
    JSON response | AssertionError: expected response body to be a valid json but got error Unexpected token 'Connection Timed Out ^
    Subscription Field | JSONError: Unexpected token 'Connection Timed Out ^
    Account type Field | JSONError: Unexpected token 'Connection Timed Out ^
    409 的错误:
    Status code | AssertionError: expected response to have status reason 'OK' but got 'CONNECTION TIMED OUT'
    JSON response | AssertionError: expected response body to be a valid json but got error Unexpected token 'Connection Timed Out ^
    Subscription Field | JSONError: Unexpected token 'Connection Timed Out ^
    Account type Field | JSONError: Unexpected token 'Connection Timed Out ^
    我的环境:
  • mac M1 Monterey
  • mongodb 6.0.11
  • node v18.18.2

    同学的环境:
  • Ubuntu 20
  • mongodb 6.0.3
  • node v18.18.1

    第一次发帖,如果需要提供更多内容会截图的,拜托了!
  • 您需要登录后才可以回帖 登录 | 立即注册

    返回顶部