From 5b00086d59b20ce982f96121ea3803f68d81797b Mon Sep 17 00:00:00 2001 From: Mike Alfare <13974384+mikealfare@users.noreply.github.com> Date: Mon, 24 Apr 2023 12:36:05 -0400 Subject: [PATCH] ADAP-382: Address TestAccessGrantSucceeds sporadic failure (#674) * try waiting between consecutive calls to run_dbt to see if it is a concurrency issue --- .changes/unreleased/Fixes-20230421-120450.yaml | 6 ++++++ tests/functional/adapter/test_grant_access_to.py | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 .changes/unreleased/Fixes-20230421-120450.yaml diff --git a/.changes/unreleased/Fixes-20230421-120450.yaml b/.changes/unreleased/Fixes-20230421-120450.yaml new file mode 100644 index 000000000..64cee345f --- /dev/null +++ b/.changes/unreleased/Fixes-20230421-120450.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: ' Fix issue of sporadic failure to apply grants during high transaction volumes' +time: 2023-04-21T12:04:50.391534-04:00 +custom: + Author: mikealfare + Issue: "614" diff --git a/tests/functional/adapter/test_grant_access_to.py b/tests/functional/adapter/test_grant_access_to.py index 89ec5a6c8..109cab125 100644 --- a/tests/functional/adapter/test_grant_access_to.py +++ b/tests/functional/adapter/test_grant_access_to.py @@ -1,6 +1,10 @@ +import time + import pytest + from dbt.tests.util import run_dbt + SELECT_1 = """ {{ config( materialized='view', @@ -43,6 +47,7 @@ def test_grant_access_succeeds(self, project): # Need to run twice to validate idempotency results = run_dbt(["run"]) assert len(results) == 2 + time.sleep(10) results = run_dbt(["run"]) assert len(results) == 2