async fn adjust_limit_increments_streak_counter_on_upward_movement() {
        let (handles, _) = setup_requester_test(None).await;

        let requester = Requester {
            handles,
            seen_links: RwLock::new(HashSet::<String>::new()),
            tuning_lock: Mutex::new(0),
            ferox_scan: Arc::new(FeroxScan::default()),
            target_url: "http://localhost".to_string(),
            rate_limiter: RwLock::new(None),
            policy_data: PolicyData::new(RequesterPolicy::AutoBail, 7),
        };

        requester.policy_data.set_reqs_sec(400);
        requester
            .adjust_limit(PolicyTrigger::Errors, true)
            .await
            .unwrap();

        assert_eq!(*requester.tuning_lock.lock().unwrap(), 1);
        assert_eq!(requester.policy_data.get_limit(), 300);
        assert_eq!(
            requester.rate_limiter.read().await.as_ref().unwrap().max(),
            300
        );
    }
/// adjust_limit should add one to the streak counter when errors from scan equal policy and
/// increase the scan rate
adjust_limit should add one to the streak counter when errors from scan equal policy and
increase the scan rate
adjust_limit should add one to the streak counter when errors from scan equal policy and increase the scan rate
async fn adjust_limit_increments_streak_counter_on_upward_movement() {
        let (handles, _) = setup_requester_test(None).await;
        let requester = Requester {
            handles,
            seen_links: RwLock::new(HashSet::<String>::new()),
            tuning_lock: Mutex::new(0),
            ferox_scan: Arc::new(FeroxScan::default()),
            target_url: "http://localhost".to_string(),
            rate_limiter: RwLock::new(None),
            policy_data: PolicyData::new(RequesterPolicy::AutoBail, 7),
        };
        requester.policy_data.set_reqs_sec(400);
        requester
            .adjust_limit(PolicyTrigger::Errors, true)
            .await
            .unwrap();
        assert_eq!(*requester.tuning_lock.lock().unwrap(), 1);
        assert_eq!(requester.policy_data.get_limit(), 300);
        assert_eq!(
            requester.rate_limiter.read().await.as_ref().unwrap().max(),
            300
        );
    }
async fn adjust_limit_increments_streak_counter_on_upward_movement ( ) { let ( handles , _ ) = setup_requester_test ( None ) . await ; let requester = Requester { handles , seen_links : RwLock :: new ( HashSet :: < String > :: new ( ) ) , tuning_lock : Mutex :: new ( 0 ) , ferox_scan : Arc :: new ( FeroxScan :: default ( ) ) , target_url : " " . to_string ( ) , rate_limiter : RwLock :: new ( None ) , policy_data : PolicyData :: new ( RequesterPolicy :: AutoBail , 7 ) , } ; requester . policy_data . set_reqs_sec ( 400 ) ; requester . adjust_limit ( PolicyTrigger :: Errors , true ) . await . unwrap ( ) ; assert_eq ! ( requester tuning_lock lock ( ) unwrap ( ) 1 ) ; assert_eq ! ( requester policy_data get_limit ( ) 300 ) ; assert_eq ! ( requester rate_limiter read ( ) await as_ref ( ) unwrap ( ) max ( ) 300 ) ; }
adjust_limit should add one to the streak counter when errors from scan equal policy and
increase the scan rate
adjust_limit should add one to the streak counter when errors from scan equal policy and increase the scan rate