Tests: Add forgotten portions of the fix to make the upgrade test not do
reallcations at the wrong time.