{"record":{"id":"b29582459e738542","repo":"dbt-labs/dbt-core","slug":"acquire-should-succeed","errorCode":null,"errorMessage":"acquire should succeed","messagePattern":"acquire should succeed","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-common/src/lease.rs","lineNumber":406,"sourceCode":"        );\n\n        cleanup(&path);\n    }\n\n    #[dbt_runtime::test]\n    async fn test_renew_valid_lease() {\n        let lease_id = \"renew-valid-lease\".to_string();\n        let path = test_lease_path();\n        let handler = Arc::new(LeaseHandler::new(\n            path.clone(),\n            \"test\".to_string(),\n            Duration::from_secs(5),\n        ));\n\n        let lease_expiry = handler\n            .acquire(lease_id.clone(), Duration::from_secs(2))\n            .await\n            .expect(\"acquire should succeed\");\n        let original_expiry = lease_expiry;\n\n        // Small sleep so renewed expiry is clearly different\n        sleep(Duration::from_millis(10)).await;\n\n        let result = handler.renew(&lease_id, Duration::from_secs(5));\n        assert!(result.is_ok(), \"renew should succeed on a valid lease\");\n        assert!(\n            result.ok().unwrap() > original_expiry,\n            \"expiry should be extended after renew\"\n        );\n\n        cleanup(&path);\n    }\n\n    #[dbt_runtime::test]\n    async fn test_renew_expired_lease() {\n        let lease_id = \"renew-expired-lease\".to_string();","sourceCodeStart":388,"sourceCodeEnd":424,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-common/src/lease.rs#L388-L424","documentation":"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.","triggerScenarios":"Thrown at crates/dbt-common/src/lease.rs:406 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check LeaseHandler::acquire for regressions","Verify the test lease file path is writable and cleaned up between runs","Treat failure as a lease subsystem bug"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}