replace test code that only succeeds by luck. fixes #1414.