On GitHub merge queues, reliability, and multiplexed serial connections

Assuming anyone was paying attention, which I suspect they are not, they would have noticed that there are a lot of queued up pull requests for Shaken Fist right now. There are a couple of factors leading to that — there are now several bots which do automated pull requests for code hygiene purposes; and a couple of months ago I decided to give GitHub’s new merge queue functionality a go in order to keep the CI resource requirements for Shaken Fist under control. All CI runs on four machines in my home office, and there were periods of time where the testing backlog would be more than 24 hours long. I can’t simply buy more hardware, and I didn’t really want to test things less.

The basic idea of GitHub merge queues is that you have a quick set of initial tests which determine if the pull request smells, and then only run the full test suite on non-stinky code which a human has signed off on. Once the human signs off, the code will only merge if the full suite passes, and GitHub manages a queue of merge attempts to keep that reasonable.

(more…)

Continue ReadingOn GitHub merge queues, reliability, and multiplexed serial connections

I think I found a bug in python’s unittest.mock library

  • Post author:
  • Post category:Python

Mocking is a pretty common thing to do in unit tests covering OpenStack Nova code. Over the years we've used various mock libraries to do that, with the flavor de jour being unittest.mock. I must say that I strongly prefer unittest.mock to the old mox code we used to write, but I think I just accidentally found a fairly big bug. The problem is that python mocks are magical. Its an object where you can call any method name, and the mock will happily pretend it has that method, and return None. You can then later ask what "methods" were called on the mock. However, you use the same mock object later to make assertions about what was called. Herein is the problem -- the mock object doesn't know if you're the code under test, or the code that's making assertions. So, if you fat finger the assertion in your test code, the assertion will just quietly map to a non-existent method which returns None, and your code will pass. Here's an example: #!/usr/bin/python3 from unittest import mock class foo(object): def dummy(a, b): return a + b @mock.patch.object(foo, 'dummy') def call_dummy(mock_dummy): f = foo() f.dummy(1, 2) print('Asserting a call should…

Continue ReadingI think I found a bug in python’s unittest.mock library

Starfish Prime

  • Post author:
  • Post category:Link

As for Starfish Prime, because there is almost no air at an altitude of 400 kilometres, no fireball formation occurred, although manifold other notable effects did occur. About 1500 kilometres (930 statute miles) away in Hawaii, the Electromagnetic pulse created by the explosion was felt as three hundred street lights failed, television sets and radios malfunctioned, burglar alarms went off and power lines fused. On Kauai, EMP shut down telephone calls to the other islands by burning out the equipment used in a microwave link. Also, the sky in the Pacific region was illuminated by an artificial aurora for more than seven minutes. In part, these effects were predicted by Nicholas Christofilos, a scientist who had earlier worked on the Operation Argus high-altitude nuclear shots. High altitude nuclear testing leads to interesting EMP effects, which is something I have known about for a while. There is good coverage of Starfish Prime at Wikipedia and some US government hearings on the issue are interesting too. Wow. Did they really break a bunch of satellites? While some of the energetic beta particles had followed of the earth's magnetic field and illuminated the sky, other high-energy electrons became trapped in man-made radiation belts…

Continue ReadingStarfish Prime

End of content

No more pages to load