Skip to content

Commit b14cf10

Browse files
test(unit): Ignore SubgraphNotFound for missing subgraphs in cleanup
Signed-off-by: Maksim Dimitrov <dimitrov.maksim@gmail.com>
1 parent 99f6901 commit b14cf10

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

store/test-store/src/store.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,11 @@ pub async fn create_subgraph_name(name: &str) -> Result<(), StoreError> {
268268

269269
pub async fn remove_subgraph(id: &DeploymentHash) {
270270
let name = SubgraphName::new_unchecked(id.to_string());
271-
SUBGRAPH_STORE.remove_subgraph(name).await.unwrap();
271+
// Ignore SubgraphNotFound errors during cleanup
272+
match SUBGRAPH_STORE.remove_subgraph(name).await {
273+
Ok(_) | Err(StoreError::SubgraphNotFound(_)) => {}
274+
Err(e) => panic!("unexpected error removing subgraph: {}", e),
275+
}
272276
let locs = SUBGRAPH_STORE.locators(id.as_str()).await.unwrap();
273277
let mut conn = primary_connection().await;
274278
for loc in locs {

0 commit comments

Comments
 (0)