Two flow tests wait for what they check, not a moment: the log fork test pushes before its last checkpoint, the scheduled test polls for its run (refs #354) f87a74fffc87
- Author
- Andy McCall @andymccall <[email protected]>
- via
- agent
agent:claude@andymccall <[email protected]> · keyless, under your grant for changes,refs,seal · key 1ba9469cf8af
- When
- · 2026-11-01 14:45 UTC
- Signature
- ◈ sealed by agent:claude@andymccall
- Hash
f87a74fffc8715b03636a4f59ff2a5ec4fe564a9f9c7521a03a1bfaf5fa04773- Depends on
- 42fa95540468 5f3fa151688e e5b97ac399e7
- Depended on by
- nothing yet
- In bookmarks
- main
- In tags
- v0.9.20 v0.9.21 v0.9.22 v0.9.23 v0.9.24
- Edits
- 3 atoms, 0 tree operations, 1 file
Browse the tree at this change
modified crates/hub/tests/flow.rs +13 −2
| … | 2230 unchanged lines |
||
| 2231 | 2231 | write(work.path(), ".flow/pipeline.kdl", "schema-version 1\n"); |
|
| 2232 | 2232 | c.commit("No jobs", &[]).unwrap(); |
|
| 2233 | 2233 | assert!(c.push("origin", false).unwrap().iter().all(|r| r.ok)); |
|
| 2234 | - | tokio::time::sleep(std::time::Duration::from_millis(300)).await; |
|
| 2235 | - | let runs = runs_of(&h.app, "andy", "nightly").await; |
|
| 2234 | + | // The push's run is recorded in the background: wait for it, as long as |
|
| 2235 | + | // a loaded machine needs (#354), rather than a fixed moment. |
|
| 2236 | + | let mut runs = runs_of(&h.app, "andy", "nightly").await; |
|
| 2237 | + | for _ in 0..150 { |
|
| 2238 | + | if runs.len() == 3 { |
|
| 2239 | + | break; |
|
| 2240 | + | } |
|
| 2241 | + | tokio::time::sleep(std::time::Duration::from_millis(100)).await; |
|
| 2242 | + | runs = runs_of(&h.app, "andy", "nightly").await; |
|
| 2243 | + | } |
|
| 2236 | 2244 | assert_eq!(runs.len(), 3); |
|
| 2237 | 2245 | assert!(runs[0].error.contains("at least one job"), "{}", runs[0].error); |
|
| 2238 | 2246 | assert_eq!(oxygenhub::flow::run_due(&h.app, due).await, 0); |
|
| … | 3437 unchanged lines |
||
| 5676 | 5684 | let text = std::fs::read_to_string(&pin).unwrap(); |
|
| 5677 | 5685 | let key = text.split_once('\n').unwrap().0; |
|
| 5678 | 5686 | std::fs::write(&pin, format!("{key}\n{}", forged.sign(&hub_id, &sk).unwrap().encode())).unwrap(); |
|
| 5687 | + | // A push first, so the real log is longer than what was seen even when |
|
| 5688 | + | // the hub's own background checkpoint already took the last one (#354). |
|
| 5689 | + | push(&a); |
|
| 5679 | 5690 | checkpoint(); |
|
| 5680 | 5691 | let err = b.fetch("origin").unwrap_err().to_string(); |
|
| 5681 | 5692 | assert!(err.contains("showed two histories") && err.contains("does not extend"), "{err}"); |
|
| … | 880 unchanged lines |