Tuesday, 29 January 2008

The first Cracow Python meetup was a huge success! With over 60 people turning up (some of them having travelled up to 3 hours(!) to get there), four presentations, and plans for next event in mind. What's even better - there are going to be three of us now to organise the next meetings. What's even *more* than better - the lectures from now on will be recorded and streamed live. Unfortunately - most of them will be in polish, but foreign speakers are also very welcome, so don't hesitate and come to Cracow! The following meetup takes place on the 21st of February.

Thursday, 24 January 2008

The problem

Running all the tests for our rails app took around 2 minutes on other machines and over 15 on mine.

The solution

Remove all network locations from System Preferences and put them back again.

The journey

I reduced the problem to a single test case with a single test method with a single line. Having no idea how exactly Rails Does Stuff, I ended up putting parts of debug output and tracing rails' inner paths this way. I got to before_filters, then spotted the filter that caused the problem - it was the "black-list" check (provided by a plugin). Obviously, it was a single line of the file: the url resolution.

Now, I was scared - it couldn't be ruby's fault! Fortunately, it wasn't: analogous python library was slow as well. Actually they didn't work at all. Even pinging a non-existent url took 7secs, and on ALL other machines (running various OS's) it took an instant. The guys from #ruby channel at freenode were helping me for around 2 hours (thanks a lot!), but still nothing seemed to fix the problem. I got pretty convinced, however, that my problem was caused by a bug in Leopard's TCP/IP implementation. Feeling a bit more firmly in the topic, I started searching in forums. And there it was: on the ruby forum. I followed the most crazy tip and found out why it was the last message in the thread.

P.S. Blogger provides an OpenID for its users! My way of celebrating the fact was signing up on djangopeople.net (great site btw!)P.S.2 Ola Bini run recently into the same problem, and put some more knowledge and investigation in solving it.

*But* most probably, there should be a better way to do this. We used the trick above to look for specific inline style, which is handled differently in safari and firefox ( a space added after a semicolon in safari). We eventually found assert_element_visible.