| 261 | |
| 262 | #[test] |
| 263 | fn reopen_loads_manifest_and_segments() { |
| 264 | use crate::engine::array::test_support::put_one; |
| 265 | use tempfile::TempDir; |
| 266 | |
| 267 | let dir = TempDir::new().unwrap(); |
| 268 | let aid = aid(); |
| 269 | { |
| 270 | let mut e = ArrayEngine::new(ArrayEngineConfig::new(dir.path().to_path_buf())).unwrap(); |
| 271 | e.open_array(aid.clone(), schema(), 0xBEEF).unwrap(); |
| 272 | put_one(&mut e, 1, 1, 7, 1); |
| 273 | e.flush(&aid, 2).unwrap(); |
| 274 | } |
| 275 | let mut e = ArrayEngine::new(ArrayEngineConfig::new(dir.path().to_path_buf())).unwrap(); |
| 276 | e.open_array(aid.clone(), schema(), 0xBEEF).unwrap(); |
| 277 | let m = e.store(&aid).unwrap().manifest(); |
| 278 | assert_eq!(m.segments.len(), 1); |
| 279 | assert!(m.durable_lsn > 0); |
| 280 | } |
| 281 | } |