(mut log: commitlog::Generic<ShortMem, [u8; 32]>, range: Range<TxOffset>)
| 31 | } |
| 32 | |
| 33 | fn fill_log(mut log: commitlog::Generic<ShortMem, [u8; 32]>, range: Range<TxOffset>) { |
| 34 | debug!("writing range {range:?}"); |
| 35 | |
| 36 | let end = range.end; |
| 37 | for i in range { |
| 38 | info!("commit {i}"); |
| 39 | log.commit([(i, [b'z'; 32])]).unwrap(); |
| 40 | } |
| 41 | log.flush().unwrap(); |
| 42 | |
| 43 | // Try to write one more, which should fail. |
| 44 | log.commit([(end, [b'x'; 32])]).unwrap(); |
| 45 | assert_matches!( |
| 46 | log.flush(), |
| 47 | Err(e) if e.kind() == io::ErrorKind::StorageFull |
| 48 | ); |
| 49 | } |
| 50 | |
| 51 | /// Tests that, when a partial write occurs, we can read all flushed commits |
| 52 | /// up until the faulty one. |
no test coverage detected
searching dependent graphs…