Skip to content

Commit 58afd8d

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

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
@@ -267,7 +267,11 @@ pub async fn create_subgraph_name(name: &str) -> Result<(), StoreError> {
267267

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

0 commit comments

Comments
 (0)