sindresorhus/speed-test

Just spins on Ping

pixmonkey opened this issue · 6 comments

Any reason the test would just spin and stick on the Ping?

Not really sure if it is an issue but it is what I am seeing when I run the test in OSX Terminal.

Do you happen to be behind a proxy? ddsol/speedtest.net#8

No. The only thing close to that would be I am using DHCP on my router.

I'm hanging on ping too. Digging into the guts of the speed-test module it was getting stuck here:
https://github.com/ddsol/speedtest.net/blob/master/index.js#L260
In my test:

  • servers.length was 3760
  • count was 5 (this value comes from default options)

The pingServers function has a loop using the smallest of the two above values. The n variable used in the loop is zero based and was never reaching 5 so that done could equal todo. changing the check to <=todo made things work:

for(var n=0;n<=todo;n++)(function(server){

edit: kept n zero based, change check to <=todo

Yep, that fixed it. Nicely done.