Repository navigation
test(storage): delegation checkpointer and SQLite fallback coverage; flows kernel floor for tinyflows-drivers #7196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b95ac6c
f8c2601
f1bd9a5
d1d3dcb
8bba9b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,7 +75,11 @@ async fn a_configured_backend_holds_cron_flows_and_flow_state() { | |
| .await | ||
| .unwrap(); | ||
|
|
||
| for path in ["cron/jobs.db", "flows/flows.db"] { | ||
| // The delegation graph's checkpointer lives on the backend too. | ||
| let delegation_config = config.clone(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Backend path of the delegation checkpointer is opened but never verified This call constructs a DriverCheckpointer and immediately drops it; the only assertion afterwards is that [RULE] test-asserts-nothing · |
||
| openhuman_core::agent::orchestration::open_delegation_checkpointer(&delegation_config).unwrap(); | ||
|
|
||
| for path in ["cron/jobs.db", "flows/flows.db", "graph_checkpoints.db"] { | ||
| assert!( | ||
| !workspace.path().join(path).exists(), | ||
| "{path} was not written" | ||
|
|
@@ -84,9 +88,21 @@ async fn a_configured_backend_holds_cron_flows_and_flow_state() { | |
|
|
||
| // Without a backend the classic databases are back in use. | ||
| assert!(openhuman_core::storage::clear()); | ||
| let fallback = config.clone(); | ||
| tokio::task::spawn_blocking(move || { | ||
| assert!(matches!( | ||
| FlowState::open(&fallback, "flow:digest"), | ||
| FlowState::Sqlite(_) | ||
| )); | ||
| }) | ||
| .await | ||
| .unwrap(); | ||
| // The flow written to the backend is not in the classic catalog. | ||
| assert!(flows::ops::flows_list(&config) | ||
| .await | ||
| .unwrap() | ||
| .value | ||
| .is_empty()); | ||
| openhuman_core::agent::orchestration::open_delegation_checkpointer(&config).unwrap(); | ||
| assert!(workspace.path().join("graph_checkpoints.db").exists()); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid asserting process-global state in a parallel test
crate::storage::installed()is process-wide state, so this test can fail depending on whether another test has installed a backend. The previous conditional assertion correctly skipped the SQLite check when a backend was present; preserve that isolation or explicitly control and restore the global storage state for this test.Additional
critiqueobservationPreserve the guard around the global storage assertion
[RULE] global-test-state
crate::storage::installed()reads process-wide storage state, not state owned by this test. Another test running in the same test binary can install a backend concurrently or before this test, making this assertion fail even thoughFlowState::openshould correctly selectDocuments. The previous conditional avoided coupling this test to global test order; restore that guard or otherwise isolate and serialize the global storage state.Suggested change for the opening observation
[RULE] test-isolation ·