Jim Kingdon's blog



Jim KingdonJim Kingdon
New York Standup 10/2/2008
edit Posted by Jim Kingdon on Thursday October 02, 2008 at 01:35PM
  • Selenium on several machines was failing with Connection Refused errors. This turned out to be caused by IPv6 entries (for example, "::1 localhost") which were added by a recent MacOS upgrade. Commenting out those entries seemed to fix the problem (or work around it, anyway).

  • Some people expressed a style preference, in rspec, for "pending" rather than an empty "it" block, to make it easy to search for pending tests. Excessive pending tests may be an anti-pattern. On the other hand, writing pending tests, at least temporarily, may be a good way to sketch out an area of functionality before it is implemented.

  • We have sometimes found that editing selenium tests (but not other ruby files) in IDEA is incredibly slow (as in, 30 second pauses). Two things to try are removing the gems directory from the project (in favor of just those gems which you need to be able to look at in IDEA), or at least removing the selenium gems. Another such example is that IDEA can be really slow editing the end of a long fixture file. This is probably IDEA 7.0.3 or 7.0.4.

Jim KingdonJim Kingdon
New York Standup 10/1/2008
edit Posted by Jim Kingdon on Wednesday October 01, 2008 at 01:29PM
  • There is a ruby meetup tonight at Outside In, at 7pm.

  • For load testing, Load Testing With Log Replay from igvita.com has a review of several common tools.

Jim KingdonJim Kingdon
New York Standup 9/30/2008
edit Posted by Jim Kingdon on Tuesday September 30, 2008 at 07:02PM
  • What's the best way to import a million records into a postgres database via ActiveRecord (which is needed to implement some application-specific logic)? We anticipate waiting a second (or so) between inserts to avoid slowing down the production database (which is under load, almost entirely reads). If there is any ActiveRecord feature which helps batch together inserts, noone knew about it. As for generally how long this will take (estimates range from 9 to 27 hours), and what the load on the production database will be, we planned on answering that with a trial run of a small number of these records.

  • We're thinking of having capistrano deploy to two demo servers, one particularly aimed at showing to prospective users of our application, and the other mostly for story acceptance. The former would be hosted at a hosting company; the latter an internally run machine. Several people reported they have done this on their projects, and the problems were minor, mostly having to do with whether the deployed location (/u/apps/whatever or some such) is different on the two machines (the solution would be to use the capistrano variables, but tracking down all the places that need to do that could be an issue).

  • Erector tip of the day: in a Rails project, you can put a file (named edit.rb or edit.html.rb) in your view directory, and Rails/Erector will find the template implicitly (as it would for ERB, HAML, etc). It is not necessary to explicitly call render from your controller method.