MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / huge_commit

Function huge_commit

crates/commitlog/src/commitlog.rs:1093–1106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1091
1092 #[test]
1093 fn huge_commit() {
1094 let mut log = mem_log::<[u8; 32]>(32);
1095
1096 log.commit([(0, [0; 32]), (1, [1; 32])]).unwrap();
1097 log.flush_and_sync().unwrap();
1098 // First segment got rotated out.
1099 assert_eq!(&log.tail, &[0]);
1100
1101 log.commit([(2, [2; 32])]).unwrap();
1102 log.flush_and_sync().unwrap();
1103
1104 // Second segment got rotated out and segment 3 is created.
1105 assert_eq!(&log.repo.existing_offsets().unwrap(), &[0, 2, 3]);
1106 }
1107
1108 #[test]
1109 fn traverse_commits() {

Callers

nothing calls this directly

Calls 3

commitMethod · 0.65
unwrapMethod · 0.45
flush_and_syncMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…