Browse Source

chore: Add comments in `*_wrong_map` tests

Michal Rostecki 7 months ago
parent
commit
e575712c59
2 changed files with 4 additions and 0 deletions
  1. 2 0
      aya/src/maps/bloom_filter.rs
  2. 2 0
      aya/src/maps/lpm_trie.rs

+ 2 - 0
aya/src/maps/bloom_filter.rs

@@ -120,6 +120,8 @@ mod tests {
 
     #[test]
     fn test_try_from_wrong_map() {
+        // This is necessary to stop miri tripping over the PERF_EVENT_ARRAY
+        // logic and attempting to open a file to read number of online CPUs.
         let map = new_map(test_utils::new_obj_map::<u32>(BPF_MAP_TYPE_ARRAY));
         let map = Map::Array(map);
 

+ 2 - 0
aya/src/maps/lpm_trie.rs

@@ -249,6 +249,8 @@ mod tests {
 
     #[test]
     fn test_try_from_wrong_map() {
+        // This is necessary to stop miri tripping over the PERF_EVENT_ARRAY
+        // logic and attempting to open a file to read number of online CPUs.
         let map = new_map(test_utils::new_obj_map::<u32>(BPF_MAP_TYPE_ARRAY));
         let map = Map::Array(map);