Symphonious

Living in a state of accord.

End to End Tests @ LMAX Update

A little while back I said that LMAX ran around 11,000 end to end tests in around 50 minutes. Since then we’ve deployed some new hardware to run our continuous integration on, plus continued building new stuff and are now running about 11,500 tests in under 20 minutes.

A large part of the speed boost is extra VM instances but also the increased RAM allocation available to each VM has allowed us to increase a number of limits in the system and we can now run more tests concurrently against each VM instance.

We’re currently running 61 instances of the exchange using virtual machines hosted by four Dell FX2s chassis three-quarter populated with FC630s. That gives us 480 cores and 4.5TiB RAM. That’s certainly no small investment, but we consider it excellent value for money because of the boost in productivity and confidence it gives our development team (not to mention the boost in confidence and reliability it gives our clients).

Testing@LMAX – Aliases

Even after a magnum opus on the DSL LMAX uses for acceptance tests, there’s one crucial feature that I haven’t mentioned: the use of aliases to allow tests to use simple, meaningful names while ensuring that uniqueness constraints are met.

Creating a user with our DSL looks like:

registrationAPI.createUser("user");

You might expect this to create a user with the username ‘user’, but then we’d get conflicts between every test that wanted to call their user ‘user’ which would prevent tests from running safely against the same deployment of the exchange.

Instead, ‘user’ is just an alias that is only meaningful while this one test is running. The DSL creates a unique username that it uses when talking to the actual system. Typically this is done by adding a postfix so the real username is still reasonably understandable e.g. user-fhoai42lfkf.

We do the same thing for instruments, venues, currencies and anything else that needs unique names.

This relatively simple trick gives us a great deal of isolation between tests that may run against the same server instance, even allowing us to run the same test multiple times without interfering with itself.

Pre-Java 8:

ThreadLocal<Foo> foo = new ThreadLocal() {
@Override
protected Foo initialValue() {
return new Foo();
}
};

Post-Java 8:

ThreadLocal<Foo> foo = ThreadLocal.withInitial(Foo::new);

Nice.

Sonos’ Support is Brilliant

I’ve spent the evening emailing back and forth with Chris from Sonos’ tech support about a strange issue I’ve experienced where the Sonos app can’t connect to the playbar (on both OS X and iOS). It turns out the problem is that my DLink wifi access point doesn’t handle multicast traffic properly – Chris knew that almost immediately but took me through each step carefully checking every assumption and taking the time to ask about settings in the terms DLink uses instead of generic ones. By the end of it all I had a solid understanding of what the problem was and a simple way to describe it to DLink’s support to see if it could be fixed. A little creativity on my end has even given me a good work around.

Normally support teams do just enough work to determine that it’s not their product at fault and then fob you off to the other company. I really appreciate the extra time Chris took to make sure I knew he was doing everything he could.

Even more impressive, all this happened on a Sunday night on the weekend between Christmas and New Year – getting responses almost immediately.

So if you’re considering a wireless speaker system – go buy a Sonos. The whole company is working hard to make it awesome for you and it shows.

Disabling Internal Speakers on a Panasonic TV

My wife and I gave each other a Sonos playbar for Christmas to improve the clarity of our TV. The initial setup was excellent – clearly stepping through each required step and very cleverly detecting the type of TV remote I have and automatically reacting to it’s volume controls so I can carry on using the TV remote as usual.

The only problem is that my Panasonic TV doesn’t provide a way to disable the internal speakers. So the playbar and the TV were both outputting sound which sounds pretty awful.  There’s two ways to solve this:

  1. Configure the Sonos to respond to a different remote (or different buttons on your TV remote such as those for a DVD or video play you don’t use). Then simply turn the volume on the TV all the way down and don’t use the normal volume buttons anymore.
  2. Access the secretive hotel mode.

The secretive hotel mode is mentioned in a bunch of places on the internet but apparently Panasonic denies it exists (unless you’re a hotel I guess). To access it on my particular version I had to hold down the -/V button on the side of the TV and press “AV” on the remote three times.

A menu then pops up providing access to a few settings including a maximum volume. Enable hotel mode and set the maximum volume to zero and you’ve effectively disabled the internal speakers.

Now when you use the volume controls both the TV and Sonos will respond but the TV volume is limited to zero so the volume bar appears on screen but the TV speakers never activate.

This gives the ideal setup – a sound system that provide significantly improved sound from the TV without any extra remotes or other complications.