sindresorhus/speed-test

Location, location...

mateatslc opened this issue · 11 comments

wherever I run it, tests against speedo.eltele.no in Alta, Norway resulting in incorrect measurements.

screen shot 2016-02-11 at 10 42 50 am

OSX 10.11.3 / iTerm2 / testing from Hungary

@mateatslc Would you be able to log what server.distance holds? https://github.com/sindresorhus/speed-test/blob/master/cli.js#L78

Seems like the speed-test API we use might not return a numeric value in your case.

server.distance is null
here is the complete server object stringified:

{
  "bestPing": 165.76601300000002,
  "cc": "NO",
  "country": "Norway",
  "dist": null,
  "distMi": null,
  "id": "3433",
  "lat": "69.9403",
  "lon": "23.3106",
  "name": "Alta",
  "sponsor": "Eltele AS",
  "url": "http://speedo.eltele.no/speedtest/upload.php"
}

Same issue, testing from China.

@sindresorhus What should be shown if distance is null? Grayed out Unknown?

ddsol commented

I'm not understanding how dist could ever be null. Is this data coming from before that line? Maybe some more console.log lines could help here, together with where these lines are.

@mateatslc I think this is related to the issue I was seeing when running this module. I was finding it always defaulting to the Norway server you mentioned as well. Digging deeper I found it to be an issue where the dependency module, speedtest.net, had a request being blocked by the speedtest.net service. See more details here: ddsol/speedtest.net#19

This should be fixed now. Reinstall speed-test, making sure it pulls in speedtest-net@1.2.5 and you should see the expected results.

@clarkio thanks! works indeed, with speedtest-net@1.2.5
@sindresorhus created #34

No need to bump the version. Because of semver, speedtest-net@1.2.5 will be installed automatically when reinstalling speed-test.

Better safe than sorry ;)

Yes, no need to bump the version. I was referring to the install log when installing speed-test to see that it shows speedtest-net@1.2.5.