test: fix flaky xlog/panic_on_broken_lsn test
The test injects an error for a replication of a particular LSN. The problem there's a pending record about the new replica written to the _cluster space on join, which may not have been flushed to WAL by the time the test injects an error. Due to the race, the test may inject an error for the _cluster row instead of the test row, which breaks its expectations. ``` [009] xlog/panic_on_broken_lsn.test.lua [ fail ] [009] [009] Test failed! Result content mismatch: [009] --- xlog/panic_on_broken_lsn.result Tue Nov 2 13:29:53 2021 [009] +++ var/rejects/xlog/panic_on_broken_lsn.reject Tue Nov 2 13:29:59 2021 [009] @@ -155,8 +155,8 @@ [009] ... [009] (found:gsub('^.*, req: ', ''):gsub('lsn: %d+', 'lsn: <lsn>')) [009] --- [009] -- '{type: ''INSERT'', replica_id: 1, lsn: <lsn>, space_id: 9000, index_id: 0, tuple: [009] - [2, "v1"]}' [009] +- '{type: ''INSERT'', replica_id: 1, lsn: <lsn>, space_id: 320, index_id: 0, tuple: [009] + [2, "34898d18-eed4-4f8a-97ff-4ffba7b42892"]}' [009] ... [009] test_run:cmd('cleanup server replica') [009] --- [009] ``` Fix this by flushing WAL before writing a broken row. Closes #4508
Please register or sign in to comment