From dfd36753241c5a903a7a9fb8085d67d2224dc72d Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sat, 10 Oct 2026 15:35:10 -0400 Subject: [PATCH] Maintainer fix-up: drop wall-clock assertions from the repeated-headers test (flaky under load; Instant::now is a disallowed method) Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/pivot.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/cmd/pivot.rs b/crates/engine/src/cmd/pivot.rs index 4f9dae5..27e0aab 100644 --- a/crates/engine/src/cmd/pivot.rs +++ b/crates/engine/src/cmd/pivot.rs @@ -1626,21 +1626,18 @@ mod tests { let mut s = Session::new(); s.new_workbook(); let mut header = vec![json!("a"), json!("A"), json!("a"), json!("a2")]; - // Thousands of equal headers (a row of check boxes, say) used to take cubic time. + // Thousands of equal headers (a row of check boxes, say) used to take cubic time; this would + // hang rather than fail a wall-clock check, which is flaky on a loaded machine. header.extend((0..3000).map(|_| json!("x"))); let data: Vec<_> = (0..header.len()).map(|i| json!(i)).collect(); let end = CellRef::new(1, header.len() as u32 - 1).a1(); s.execute("range.setValues", json!({"range": "A1", "values": [header, data]})).unwrap(); - let t = std::time::Instant::now(); let src = crate::pivot::read_source(&s.doc().unwrap().wb, &format!("Sheet1!A1:{end}"), 0).unwrap(); - assert!(t.elapsed().as_secs_f64() < 2.0, "took {:?}", t.elapsed()); assert_eq!(&src.headers[..4], ["a", "A2", "a3", "a22"]); assert_eq!(src.headers[4], "x"); assert_eq!(src.headers.last().map(String::as_str), Some("x3000")); // Table column names follow the same rule. - let t = std::time::Instant::now(); s.execute("insert.table", json!({"range": format!("A1:{end}"), "header": true})).unwrap(); - assert!(t.elapsed().as_secs_f64() < 2.0, "took {:?}", t.elapsed()); let text = |s: &mut Session, a: &str| s.execute("cell.get", json!({"cell": a})).unwrap()["text"].clone(); assert_eq!(text(&mut s, "B1"), "A2"); let last = CellRef::new(0, 3003).a1();