Order the results before the ROW_NUM restriction is applied (and make related infrastructure tests more robust)