dbt-labs/dbt-core · error

acquire should succeed

Error message

acquire should succeed

What it means

Test-only assertion in test_renew_valid_lease: acquiring a fresh lease on the test lease file must succeed before renewal is exercised. Fires only if lease acquisition logic regresses or the test lease path is not writable.

Solutions

  1. Check LeaseHandler::acquire for regressions
  2. Verify the test lease file path is writable and cleaned up between runs
  3. Treat failure as a lease subsystem bug
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/dbt-common/src/lease.rs:406 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07). Data as JSON: /api/errors/b29582459e738542. Report an issue: GitHub.

Appendix: source

Thrown at crates/dbt-common/src/lease.rs:406

        );

        cleanup(&path);
    }

    #[dbt_runtime::test]
    async fn test_renew_valid_lease() {
        let lease_id = "renew-valid-lease".to_string();
        let path = test_lease_path();
        let handler = Arc::new(LeaseHandler::new(
            path.clone(),
            "test".to_string(),
            Duration::from_secs(5),
        ));

        let lease_expiry = handler
            .acquire(lease_id.clone(), Duration::from_secs(2))
            .await
            .expect("acquire should succeed");
        let original_expiry = lease_expiry;

        // Small sleep so renewed expiry is clearly different
        sleep(Duration::from_millis(10)).await;

        let result = handler.renew(&lease_id, Duration::from_secs(5));
        assert!(result.is_ok(), "renew should succeed on a valid lease");
        assert!(
            result.ok().unwrap() > original_expiry,
            "expiry should be extended after renew"
        );

        cleanup(&path);
    }

    #[dbt_runtime::test]
    async fn test_renew_expired_lease() {
        let lease_id = "renew-expired-lease".to_string();

View on GitHub (pinned to 0267ce9170)