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

Need to understand failed tests #61

Closed
jimaek opened this issue Mar 30, 2022 · 4 comments
Closed

Need to understand failed tests #61

jimaek opened this issue Mar 30, 2022 · 4 comments

Comments

@jimaek
Copy link
Member

jimaek commented Mar 30, 2022

e.g. If I ping something random the hostname won't get resolved and I will get this error

# ping google12344.com
ping: google12344.com: Name or service not known

But our API will keep running for 30 seconds until it times out and returns

{
  "id": "HVXCBTN9KIj8HIWN",
  "type": "ping",
  "status": "finished",
  "createdAt": 1648656181924,
  "updatedAt": 1648656211933,
  "results": [
    {
      "probe": {
        "continent": "EU",
        "region": "eastern-europe",
        "country": "PL",
        "state": null,
        "city": "krakow",
        "asn": 43939,
        "longitude": 19.9968,
        "latitude": 49.9979
      },
      "result": {}
    }
  ]
}

I think it will be a major problem for our users. e.g. a user using our web tools or even CLI will get blocked for 30 seconds while he waits for a problematic test to finish.

We need a way to understand when tests fail and return the error. I dont think it should be too hard because the binary command will fail and exit, I dont understand why we have to wait for something. If the binary exited, then catch it and return the output of the error.

This applies to all commands.

@patrykcieszkowski
Copy link
Contributor

patrykcieszkowski commented Mar 30, 2022

the probe does seem to detect the error, it just doesn't report it back

[2022-03-30 16:13:48] [DEBUG] [1184369] [general] ping request 8V1sjGjVdEeKEBlN received
[2022-03-30 16:13:48] [ERROR] [1184369] [general] failed to run the measurement. Command failed with exit code 2: ping -c 3 -i 0.2 -w 3 -n google12344.com
ping: google12344.com: Name or service not known

and its mentioned in the code
https://github.com/jsdelivr/globalping-probe/blob/master/src/index.ts#L57

@jimaek
Copy link
Member Author

jimaek commented Mar 30, 2022

Ok that's good. Just make sure to test it very well to work with all kinds of different errors and all commands we support.

@patrykcieszkowski
Copy link
Contributor

that's the problem. It's hard to know exactly why it fails. Best we could do is some simple regex matching

@jimaek
Copy link
Member Author

jimaek commented Mar 30, 2022

We dont need to know why, it would probably be too difficult, as long as we detect the failure and return the output it should work fine.
We could maybe use exit codes to detect failures https://stackoverflow.com/questions/921398/exit-status-of-ping-command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants