Optimizing your life for happiness.
Working remotely sounds pretty amazing, but I’m not sure I can handle the lack of interaction. I tried working from home for a few days and it was pretty lonely - perhaps in a co-working space, or with more frequent Google Hangouts. All the same, I definitely need to spend more time optimizing my life for happiness. I spend a lot of time optimizing my programming habits in Emacs, but hardly any for the same repetitive tasks in my real life. hummmm!
inspecting the gearman queue
I’ve been using Gearman to queue automation jobs at work. It works fine - it’s actually the part of my browser automation stack that I know the least about, but thankfully that’s because there hasn’t been much to fix about it. It mostly just sits there and does what it’s supposed to do: wait for jobs, put them in the queue, run them with the workers, then wait for more jobs. Unfortunately, we ran into an issue today where we had over fifty jobs in the queue. At only five workers and approximately five minutes per job, things were unacceptably slow.
I still haven’t figured out how to inspect the actual jobs in the queue - according to stackoverflow, it looks like I’d need to write something entirely application side to be able to do that sort of inspection. I was able to find the following bash commands in another stackoverflow post that gave some visibility into Gearman’s surprisingly opaque queue:
(echo status ; sleep 0.1) | nc 127.0.0.1 4730
(echo workers ; sleep 0.1) | nc 127.0.0.1 4730
Gearman usually runs on localhost (127.0.0.1) and on port 4730.
nc might need to be replaced by netcat, depending on your machine - it is just used to open a connection to Gearman. Two administrative commands that Gearman accepts are
Status sends back a list of registered functions, the number of running jobs per function, and the number of workers who are capable of doing that job. The
workers command returns a list of all workers with additional information on them. The
sleep is just so the connection stays open long enough for Gearman to respond with some information.
So, that was marginally useful at least - knowing why the tests were running so slowly is slightly better than just having slow tests, right? :p
Watching logs on 3 remote boxes and SSH’ing into one of them - one command, thanks to Emacs :D
I have a repeated use case where I’m interested in the logs of three different remote boxes, and I also need to SSH into one of them to run a shell script. I got fed up with doing this multiple times a day (
Read More »
ssh box1;tail -f log;ssh box2; tail -f log;ssh box3; tail -f log;. shellscript.sh gets oooold), so I went about making life easier for myself, fumbling and stumbling through Elisp on the way :)
Well, this is really great. There’s a couple of bugs in WebDriver that I can’t solve and this was one of them. Reproduction cases are in the ticket but essentially sometimes Firefox would just complain that it didn’t have permission to do standard things like click on a link or focus on an iframe.
I ran into it a couple times and my hack was just to ignore the exception and try the offending action again before continuing bravely on, as it sometimes threw the exception while actually performing the desired action. Glad to hear this is fixed in FF 15.
Along with the announcement of Apple Sauce and Android Sauce, all my blocker issues for test automation are dropping like flies. Yay :)
Someone at my workplace had a bad time last weekend. Their bike in the top right of the picture no longer has a front wheel. Sad face!
Not sure if you can tell from the photo, but they were only using a cable lock that was not looped through the tires. Also, their tires are quick release tires. Basically, with a setup like that it’s only a matter of time. All the same, I am pretty surprised about the fact that it happened there because it’s seems like a pretty nice part of town.
In general you at least want a thick U-lock that is large enough to get include one of your tires in it. My U-lock isn’t big enough to go around the tire, though. Bonus points if you lock it with the key hole facing down, and make it tight enough that robbers can’t slip anything between the U-lock to wedge it open. After that, you want at least a cable running through both of your tires and affixed to the lock. Additional bonus points for changing location everyday, so robbers can’t scout and plan for your bike, as well as choosing a place in plain view, although pedestrians usually don’t stop bike thieves anyway.
It’s sad but the whole motivation is to make your bike less appealing so a thief will take some one else’s bike, under the assumption that the crime is one of opportunity and not personally motivated.
Today, Sauce Labs is very happy to announce the general availability of OS X, iOS, and Android in the Sauce cloud testing services. Mobile web and desktop web
This is really cool. I had just started considering switching to TestingBot because they offered similar functionality, in particular Android and OS X cloud testing. But now it’s on Saucelabs :D
Now I just gotta figure out why my tests keep timing out on pageload. Grr….
Clearing your browser data in Chrome without using the mouse :)
At work, I have to clear my Chrome browser history, data, and what have you on a pretty regular basis. There’s a couple ways of doing it with the mouse but they’re all pretty slow. You could bring up the settings page from the wrench and then
Settings ⌘+,, get defaulted into the search bar and type
clear, then click on
Clear browsing data, and then move the mouse down and click on
Clear browsing data again, but that’s pretty cumbersome.
Luckily, there is a shortcut specifically for clearing your history:
⌘+<Shift>+<Backspace> brings up a new settings tab with the clear browsing data dialogue all focused. The last step is actually clicking the button, and for a while I just moved my hand to my mouse and clicked it, but I found a better way! If you just wait for the new tab and clear dialogue to finish loading, you can just hit
<Shift>+<TAB> and you’ll be on the
Clear browsing data button! One last
<Enter> and you’re on your way :)
In Windows, there’s no
⌘, so instead it’s
<Ctrl>+<Shift>+<Delete>. In addition, the order of the
Clear browsing data buttons are reversed on Windows, so it requires two invocations of
<Shift>+<TAB> to get to the correct button, but it’s way better than using a mouse :D.
In fact, this works with varying degrees of success for Firefox and IE too - some combination of
⌘/<Ctrl>+<Shift>+<Backspace>/<Delete> should bring up the dialogue for most modern browsers…
I’ve watched the meaning of the word “refactoring” drift over the past several years. I don’t know if this is specific to the Ruby community or a larger problem in the software industry. But on nearly every project I’ve been on, I’ve heard statements like this in iteration planning meetings:
Oh, this feature is going to touch the Frotz class. We’ll need to add some time to the estimation. The Frotz class is a huge mess, we really need to schedule time to refactor it.
Nearly every project has had areas which everyone recognized as painful. In fact, everyone had been recognizing those areas as painful for weeks or months. If there’s an area of the code that everyone has recognized as painful for weeks, the time for refactoring has been and gone. […]
I’ve only been on one software project, but Avdi Grimm’s piece already really rings true to me. This distinction between refactoring and cleaning up that scary class of which everyone is ashamed is incredibly useful, especially for product to be able to see the process clearly instead of being impatient and intimidated. As I’ve learned throughout the last year, in software development (and everything else?), perception is paramount.
interactive saucelabs ondemand tests :o
I don’t know when this change happened, but apparently while my OnDemand scripts are running on Saucelabs, if you go watch the video while it’s going, you can interact with the browser the same way that you can during a Scout session? That’s pretty cool, although I guess not entirely useful if the automated tests are working as expected, since they shouldn’t require any human interaction.
But, it would be pretty nice for debugging some of the weird things that happen during a test. One of the websites we test loads perfectly fine in a normal browser but in OnDemand testing it takes upwards of 100 seconds to load the homepage. I can’t really tell which calls are taking forever, and it’s inconsistent enough that I can’t do anything about it without more information. Prior to this discovery, I was going to investigate inserting the BrowserMob proxy into my automation stack somewhere, but now I can just set a breakpoint in my script and use the built-in developer network tabs in Firefox and Chrome to see what calls are slow.
Window Management in OS X with Multiple Monitors: SizeUp
At work, I’m using OS X where I’m not very comfortable with window management and resizing. I’ve never quite gotten used to the default behavior of the green + button in the top left of the OS X windows. Not only can I not resize things easily as I would expect, I was also running into repeated cases of moving windows between my two monitors and between different spaces. Size Up solves all these problems for me in a transparent and keyboard-centric fashion :)
Read More »