Skip to content

Commit

Permalink
add verification in filter_timout test
Browse files Browse the repository at this point in the history
  • Loading branch information
justRkive committed Jan 10, 2024
1 parent 8fe7158 commit e65683e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/dns_cache/cache_by_record_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -923,13 +923,16 @@ mod cache_data_test{
assert_eq!(rrstore_data_vec_ns.len(), 1);
}
}
assert_eq!(record_types_data.len(), 2);

println!("Before timeout: {:?}", Utc::now());
thread::sleep(time::Duration::from_secs(5));
println!("After timeout: {:?}", Utc::now());
cache_record_type.filter_timeout_by_rtype();

let record_types_data_after_cleaning = cache_record_type.get_cache_data();

assert_eq!(record_types_data_after_cleaning.len(), 1);

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()){
Expand Down

0 comments on commit e65683e

Please sign in to comment.