Skip to content

Commit 4deea82

Browse files
En-queue in-progress steps in same transaction as artifact ID
1 parent a6dcd52 commit 4deea82

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

collector/src/main.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,23 @@ fn bench(
207207
);
208208
}
209209

210-
let interned_cid = rt.block_on(conn.artifact_id(&cid));
211-
212-
let start = Instant::now();
213210
let steps = benchmarks
214211
.iter()
215212
.map(|b| b.name.to_string())
216213
.collect::<Vec<_>>();
217-
rt.block_on(conn.collector_start(interned_cid, &steps));
214+
215+
// Make sure there is no observable time when the artifact ID is available
216+
// but the in-progress steps are not.
217+
let interned_cid = {
218+
let mut tx = rt.block_on(conn.transaction());
219+
let interned_cid = rt.block_on(tx.conn().artifact_id(&cid));
220+
rt.block_on(tx.conn().collector_start(interned_cid, &steps));
221+
222+
rt.block_on(tx.commit()).unwrap();
223+
interned_cid
224+
};
225+
226+
let start = Instant::now();
218227
let mut skipped = false;
219228
for (nth_benchmark, benchmark) in benchmarks.iter().enumerate() {
220229
let is_fresh =

0 commit comments

Comments
 (0)