Skip to content

Integration tests fail due to stale state on shared Connect instance #460

@tdstein

Description

@tdstein

Problem

Integration tests are failing intermittently due to leftover state on the shared Connect instance. Observed in CI run #23011094234:

  • 2 failures, 12 errors in integration tests
  • 0 failures in unit tests

Errors (12)

All test_groups tests error with:

posit.connect.errors.ClientError: {"error_code": 15, "error_message": "The requested group name is already in use.", "http_status": 409, "http_message": "Conflict"}

Several other tests (test_jobs, test_tags, test_users, test_vanities) error with assert 1 == 0 on content.count(), indicating content from previous test runs was not cleaned up.

Failures (2)

Also related to stale content state — tests assume content.count() == 0 but find pre-existing content items.

Root cause

Integration test setup/teardown does not reliably clean up resources (groups, content items) on the Connect instance. When a previous test run fails partway through or teardown is incomplete, subsequent runs encounter conflicting state.

Suggested fix

  • Ensure test fixtures clean up created resources in teardown (even on failure), or
  • Use unique names per test run (e.g., with a timestamp/UUID suffix) to avoid conflicts, or
  • Add a pre-test cleanup step that removes resources from prior runs

Metadata

Metadata

Assignees

No one assigned

    Labels

    sdkUsed for automation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions