dbt-core icon indicating copy to clipboard operation
dbt-core copied to clipboard

[CT-3008] test_changed_seed_config is flaky

Open QMalcolm opened this issue 2 years ago • 1 comments

tests/functional/defer_state/test_modified_state.py::TestChangedSeedConfig.test_changed_seed_config fails intermittently. Example: https://github.com/dbt-labs/dbt-core/actions/runs/5883684479/job/15956867280 (rerunning succeeded).

Failure state is as follows


self = <test_modified_state.TestChangedSeedConfig object at 0x11365c940>
project = <dbt.tests.fixtures.project.TestProjInfo object at 0x114b80eb0>

    def test_changed_seed_config(self, project):
>       self.run_and_save_state()

/Users/runner/work/dbt-core/dbt-core/tests/functional/defer_state/test_modified_state.py:270: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/Users/runner/work/dbt-core/dbt-core/tests/functional/defer_state/test_modified_state.py:79: in run_and_save_state
    run_dbt(["run"])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = ['run', '--project-dir', '/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pytest-of-runner/pytest-0/project33', '--profiles-dir', '/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pytest-of-runner/pytest-0/profile33']
expect_pass = True

    def run_dbt(
        args: Optional[List[str]] = None,
        expect_pass: bool = True,
    ):
        # Ignore logbook warnings
        warnings.filterwarnings("ignore", category=DeprecationWarning, module="logbook")
    
        # reset global vars
        reset_metadata_vars()
    
        # The logger will complain about already being initialized if
        # we don't do this.
        log_manager.reset_handlers()
        if args is None:
            args = ["run"]
    
        print("\n\nInvoking dbt with {}".format(args))
        from dbt.flags import get_flags
    
        flags = get_flags()
        project_dir = getattr(flags, "PROJECT_DIR", None)
        profiles_dir = getattr(flags, "PROFILES_DIR", None)
        if project_dir and "--project-dir" not in args:
            args.extend(["--project-dir", project_dir])
        if profiles_dir and "--profiles-dir" not in args:
            args.extend(["--profiles-dir", profiles_dir])
    
        dbt = dbtRunner()
        res = dbt.invoke(args)
    
        # the exception is immediately raised to be caught in tests
        # using a pattern like `with pytest.raises(SomeException):`
        if res.exception is not None:
            raise res.exception
    
        if expect_pass is not None:
>           assert res.success == expect_pass, "dbt exit state did not match expected"
E           AssertionError: dbt exit state did not match expected

QMalcolm avatar Aug 17 '23 17:08 QMalcolm

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

github-actions[bot] avatar Feb 14 '24 01:02 github-actions[bot]

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.

github-actions[bot] avatar Feb 22 '24 01:02 github-actions[bot]