browsertime
browsertime copied to clipboard
Provide an option so that we don't need to run sudo commands
Feature/improvement
When running browsertime on Linux, commands are run using sudo. It's a bit surprising and not really nice. It would be good to:
- explain what is executed using
sudoin the console - have a possibility to skip these commands at all
Hi @julienw can you show me how you run? You should be able to run without sudo but if you set connectivity using connectivity engine throttle, you need sudo rights to be able change network interface. That log message "Changing network interfaces needs sudo rights. Setting connectivity profile .." could be tuned though, do you have an idea how we can make that better?
I cloned the browsertime repository, ran npm ci on it, and then simply use this command:
$ bin/browsertime.js -b firefox --firefox.binaryPath /home/julien/firefox-nightly/firefox https://profiler.firefox.com
[2022-04-01 14:38:46] INFO: Running tests using Firefox - 3 iteration(s)
[sudo] Mot de passe de julien :
I also tried with --skipHar as I thought this could be related but this brought the same result.
This happens also with chrome:
$ bin/browsertime.js https://profiler.firefox.com
[2022-04-01 14:40:03] INFO: Running tests using Chrome - 3 iteration(s)
[sudo] Mot de passe de julien :
So I'm not sure this is related to the connectivity engine throttle... The message you mention looks good enough to me.
Ok, hmm, that shouldn't be a thing. Do you have other NodeJS projects installed that works fine? I'll have a try later this weekend.
Yeah usually I have no problem running nodejs scripts :) I'm on a Debian Linux in case this helps, node v16.13.
I finally ran it (by mistake: I ran sudo before and forgot :) ) and so got the executed programs in my system logs:
Apr 1 17:25:19 torri sudo: julien : TTY=pts/5 ; PWD=/home/julien/travail/git/browsertime ; USER=root ; COMMAND=/usr/bin/systemd-resolve --flush-caches
Apr 1 17:25:19 torri sudo: julien : TTY=pts/5 ; PWD=/home/julien/travail/git/browsertime ; USER=root ; COMMAND=/usr/sbin/service dnsmasq restart
Then this is this code: https://github.com/sitespeedio/browsertime/blob/d55019ab041ad818295c8d940561217099e18ccc/lib/support/dns.js#L27-L38
Argh I see, that is my fault. I pushed that some time ago and it would make more sense to only do that when you run throttle, let me fix that to the next release.
This is fixed now, thanks @julienw for creating the bug!
Thanks for the quick fix! Should we close the issue then?
Yes wanted you to verify that it worked for you first :)
Yep, it's all good now!