Keep num_covered_map_indexes in sync with history map if block listing flaky entries (#2542)
This commit is contained in:
parent
f0d85aaaa5
commit
bacbffa6c1
@ -212,11 +212,11 @@ where
|
|||||||
.as_ref()
|
.as_ref()
|
||||||
.to_vec();
|
.to_vec();
|
||||||
|
|
||||||
let history_map = &mut state
|
let map_state = state
|
||||||
.named_metadata_map_mut()
|
.named_metadata_map_mut()
|
||||||
.get_mut::<MapFeedbackMetadata<O::Entry>>(&self.map_name)
|
.get_mut::<MapFeedbackMetadata<O::Entry>>(&self.map_name)
|
||||||
.unwrap()
|
.unwrap();
|
||||||
.history_map;
|
let history_map = &mut map_state.history_map;
|
||||||
|
|
||||||
if history_map.len() < map_first_len {
|
if history_map.len() < map_first_len {
|
||||||
history_map.resize(map_first_len, O::Entry::default());
|
history_map.resize(map_first_len, O::Entry::default());
|
||||||
@ -228,6 +228,10 @@ where
|
|||||||
.enumerate()
|
.enumerate()
|
||||||
{
|
{
|
||||||
if *first != *cur && *history != O::Entry::max_value() {
|
if *first != *cur && *history != O::Entry::max_value() {
|
||||||
|
// If we just hit a history map entry that was not covered before, but is now flagged as flaky,
|
||||||
|
// we need to make sure the `num_covered_map_indexes` is kept in sync.
|
||||||
|
map_state.num_covered_map_indexes +=
|
||||||
|
usize::from(*history == O::Entry::default());
|
||||||
*history = O::Entry::max_value();
|
*history = O::Entry::max_value();
|
||||||
unstable_entries.push(idx);
|
unstable_entries.push(idx);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user