showwin/speedtest-go

JSON output doesn't work when a server has same coordinates as client (regression)

Closed this issue · 9 comments

Running speedtest-go.exe --server <server_id1> --server <server_id2> --json returns empty output.
Running speedtest-go.exe --server <server_id1> --json works.
This looks like a regresion in version 1.6.7, since this use case works as expected in versions 1.6.5 and 1.6.6 as far a I tested.
Tested on Windows, binaries version: speedtest-go_1.6.7_Windows_x86_64.tar.gz

Hi @r3inbowari ,
I performed more tests and I think the issue is different than I thought. It is not related to specifying multiple servers.
The --json option seems to fail when speed test runs against specific server, or when that server is one of several specified servers:
speedtest-go.exe --server 17022 --json
I think the "special" thing about this specific server 17022 is that it returns NaNkm as distance.
When I run without --json it looks like this:

C:\speedtest-go>speedtest-go.exe --server 17022

    speedtest-go v1.6.7 @showwin

✓ ISP: <redacted>
✓ Found 1 Specified Public Servers

✓ Test Server: [17022] NaNkm Tel Aviv by Partner Communications
✓ Latency: 3.008215ms Jitter: 617.01µs Min: 1.8998ms Max: 4.1099ms
✓ Download: 854.02Mbps (used: 1018.07MB) (latency: 10ms jitter: 6ms min: 2ms max: 24ms)
✓ Upload: 253.94Mbps (used: 302.72MB) (latency: 3ms jitter: 1ms min: 1ms max: 9ms)

Hi @r3inbowari , I performed more tests and I think the issue is different than I thought. It is not related to specifying multiple servers. The --json option seems to fail when speed test runs against specific server, or when that server is one of several specified servers: speedtest-go.exe --server 17022 --json I think the "special" thing about this specific server 17022 is that it returns NaNkm as distance. When I run without --json it looks like this:

C:\speedtest-go>speedtest-go.exe --server 17022

    speedtest-go v1.6.7 @showwin

✓ ISP: <redacted>
✓ Found 1 Specified Public Servers

✓ Test Server: [17022] NaNkm Tel Aviv by Partner Communications
✓ Latency: 3.008215ms Jitter: 617.01µs Min: 1.8998ms Max: 4.1099ms
✓ Download: 854.02Mbps (used: 1018.07MB) (latency: 10ms jitter: 6ms min: 2ms max: 24ms)
✓ Upload: 253.94Mbps (used: 302.72MB) (latency: 3ms jitter: 1ms min: 1ms max: 9ms)

Yes, I found error: json: unsupported value: NaN

Hi, @paveldanichev, I have a question, why is the distance calculated as NaN. Could you provide your current coordinates?
If this is private, you can send it to my email: r3inbowari@gmail.com.

you can get the your location coordinates by https://www.speedtest.net/api/ios-config.php.
image

Thank you!

Output of https://www.speedtest.net/api/ios-config.php:
Client part:

<client country="IL" ip="redacted" isp="redacted" ispid="redacted" carrier="" carrierid="0" carriername="" carriermcc="" carriermnc="" ipint="redacted" lat="32.0803" lon="34.7805" usemiles="0" version="2.1.2" pp="0" msgdate="" msg="" latestver="3.8.3.66"/>

Server part:

<server url="http://speedtest2.partner.co.il:8080/speedtest/upload.php" lat="32.0803" lon="34.7805" name="Tel Aviv" sponsor="Partner Communications" id="17022" sponsor_adj="0"/>

Hi @r3inbowari ,
It appears that this server 17022 has exactly the same coordinates as client in my case. It is probably the ISPs gateway to the internet.

image Yes, this was an unexpected error.

Related to #49

We try another variant to calculate creat-circle distance now. @paveldanichev, thank you for your patient feedback!

Releases v1.6.8

Issue seems resolved in release 1.6.8.
Thank you @r3inbowari for your responsiveness. I really enjoy this utility.