mononoke: fix flaky test test-walker-corpus.t

Summary:
This is expected to fix flakyness in test-walker-corpus.t

The problem was that if a FileContent node was reached via an Fsnode it did not have a path associated.  This is a race condition that I've not managed to reproduce locally, but I think is highly likely to be the reason for flaky failure on CI

Reviewed By: ikostia

Differential Revision: D22866956

fbshipit-source-id: ef10d92a8a93f57c3bf94b3ba16a954bf255e907
This commit is contained in:
Alex Hornby 2020-07-31 10:20:33 -07:00 committed by Facebook GitHub Bot
parent cc2b5c04ca
commit 5f71745810
2 changed files with 12 additions and 5 deletions

View File

@ -48,23 +48,26 @@ Check the corpus dumped to disk agrees with the walk stats
full/HgManifest 444
Repeat but using the sample-offset to slice. Offset zero will tend to be larger as root paths sample as zero. 2000+475+611=3086
$ for i in {0..2}; do mkdir -p slice/$i; mononoke_walker --storage-id=blobstore --readonly-storage corpus -q --bookmark master_bookmark -I deep --output-dir=slice/$i --sample-rate=3 --sample-offset=$i 2>&1; done | strip_glog
$ for i in {0..2}; do mkdir -p slice/$i; echo slice $i; mononoke_walker --storage-id=blobstore --readonly-storage corpus -q --bookmark master_bookmark -I deep --output-dir=slice/$i --sample-rate=3 --sample-offset=$i 2>&1; done | strip_glog
slice 0
Walking roots * (glob)
Walking edge types * (glob)
Walking node types * (glob)
Final count: * (glob)
Final count: (43, 43)
* Run */s,*/s,2000,17,*s; * (glob)
Walked/s,* (glob)
slice 1
Walking roots * (glob)
Walking edge types * (glob)
Walking node types * (glob)
Final count: * (glob)
Final count: (43, 43)
* Run */s,*/s,475,9,*s; * (glob)
Walked/s,* (glob)
slice 2
Walking roots * (glob)
Walking edge types * (glob)
Walking node types * (glob)
Final count: * (glob)
Final count: (43, 43)
* Run */s,*/s,611,10,*s; * (glob)
Walked/s,* (glob)

View File

@ -643,9 +643,13 @@ async fn fsnode_step(
));
}
FsnodeEntry::File(file) => {
edges.push(OutgoingEdge::new(
edges.push(OutgoingEdge::new_with_path(
EdgeType::FsnodeToFileContent,
Node::FileContent(*file.content_id()),
Some(WrappedPath::from(MPath::join_element_opt(
path.as_ref(),
Some(child),
))),
));
}
}