Skip to content

Commit 8c1006c

Browse files
committed
Place SP task dumps under sp_task_dumps/ in support bundles
`spawn_collection_steps` creates an `sp_task_dumps/` directory in the bundle root, but the per-SP closure it spawned captured the framework's outer `dir` (the bundle root) instead of the subdirectory. As a result the dumps landed at `<root>/sled_0/dump-0.zip`, `<root>/switch_0/...`, etc., while `sp_task_dumps/` was created and left empty. Capture `sp_dumps_dir` into the spawned closure so dumps land at `sp_task_dumps/{sp.type}_{sp.slot}/dump-{i}.zip` as the surrounding code intended.
1 parent d180d48 commit 8c1006c

2 files changed

Lines changed: 16 additions & 10 deletions

File tree

dev-tools/omdb/tests/test_all_output.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,9 +472,15 @@ async fn test_omdb_success_cases() {
472472
});
473473
let mut archive =
474474
zip::ZipArchive::new(zip_file).expect("bundle is a valid zip archive");
475-
for required in
476-
["bundle_id.txt", "meta/reason_for_creation.txt", "meta/trace.json"]
477-
{
475+
for required in [
476+
"bundle_id.txt",
477+
"meta/reason_for_creation.txt",
478+
"meta/trace.json",
479+
"sp_task_dumps/sled_0/dump-0.zip",
480+
"sp_task_dumps/sled_1/dump-0.zip",
481+
"sp_task_dumps/switch_0/dump-0.zip",
482+
"sp_task_dumps/switch_1/dump-0.zip",
483+
] {
478484
assert!(
479485
archive.by_name(required).is_ok(),
480486
"bundle zip is missing expected entry {required}",

support-bundle-collection/src/steps/sp_dumps.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ pub async fn spawn_collection_steps(
4848

4949
let mut extra_steps: Vec<CollectionStep> = vec![];
5050
for sp in available_sps {
51+
let mgs_client = mgs_client.clone();
52+
let sp_dumps_dir = sp_dumps_dir.clone();
5153
extra_steps.push(CollectionStep::new(
5254
format!("SP dump for {:?}", sp),
53-
Box::new({
54-
let mgs_client = mgs_client.clone();
55-
move |collection, dir| {
56-
async move {
57-
collect_sp_dump(collection, &mgs_client, sp, dir).await
58-
}
59-
.boxed()
55+
Box::new(move |collection, _dir| {
56+
async move {
57+
collect_sp_dump(collection, &mgs_client, sp, &sp_dumps_dir)
58+
.await
6059
}
60+
.boxed()
6161
}),
6262
));
6363
}

0 commit comments

Comments
 (0)