Skip to content

Commit

Permalink
FIx: add new update variable in tests who fails in cache by record (s…
Browse files Browse the repository at this point in the history
…till fail)
  • Loading branch information
konegoro committed Jan 8, 2024
1 parent 68ab57a commit 0b457b9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/dns_cache/cache_by_record_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,9 @@ mod cache_data_test{
println!("After timeout: {:?}", Utc::now());
cache_record_type.filter_timeout_cache_data();

if let Some(record_types_data_a) = record_types_data.get(&Rtype::A) {
let record_types_data_after_clean = cache_record_type.get_cache_data();

if let Some(record_types_data_a) = record_types_data_after_clean.get(&Rtype::A) {
if let Some(rrstore_data_vec_a) = record_types_data_a.clone().get_from_host_data(domain_name.clone()){
//the valid one still having the value
assert_eq!(rrstore_data_vec_a.len(), 1);
Expand Down Expand Up @@ -926,7 +928,9 @@ mod cache_data_test{
println!("After timeout: {:?}", Utc::now());
cache_record_type.filter_timeout_cache_data();

if let Some(record_types_data_a) = record_types_data.get(&Rtype::A) {
let record_types_data_after_cleaning = cache_record_type.get_cache_data();

if let Some(record_types_data_a) = record_types_data_after_cleaning.get(&Rtype::A) {
if let Some(rrstore_data_vec_a) = record_types_data_a.clone().get_from_host_data(domain_name_1.clone()){
//the valid one still having the value
assert_eq!(rrstore_data_vec_a.len(), 1);
Expand All @@ -940,4 +944,5 @@ mod cache_data_test{
assert!(true);
}
}

}

0 comments on commit 0b457b9

Please sign in to comment.