Skip to content

Attempt to fix acl tests #555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Attempt to fix acl tests #555

wants to merge 3 commits into from

Conversation

Mongey
Copy link
Owner

@Mongey Mongey commented Jun 5, 2025

  • fix(resource_kafka_acl): fix ACL not found detection logic
  • feat(resource_kafka_acl): add retry logic for ACL creation
  • feat(resource_kafka_acl): add retry logic for ACL deletion

Mongey and others added 3 commits June 5, 2025 11:20
Fixed a bug in aclRead where the ACL detection logic was incorrect:
- Changed from using aclNotFound=true to found=false for clearer logic
- Fixed break statement to continue when no ACLs found for a resource
- Properly set found=true when an exact ACL match is found
- Inverted the final check to use \!found instead of aclNotFound

This ensures ACLs are properly detected during read operations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Added waitForACLToBeVisible function to ensure ACLs are visible in Kafka
before aclCreate returns. This addresses race conditions where tests check
for ACLs immediately after creation.

The retry logic:
- Attempts up to 10 times with 200ms intervals (2 seconds total)
- Invalidates cache before each check to ensure fresh data
- Checks for exact ACL match using string comparison
- Respects context cancellation for proper timeout handling

This ensures ACL creation operations complete successfully and are
visible in Kafka before Terraform proceeds.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Added waitForACLToBeDeleted function to ensure ACLs are removed from Kafka
before aclDelete returns. This addresses race conditions in tests and ensures
consistent behavior.

The retry logic:
- Attempts up to 10 times with 200ms intervals (2 seconds total)
- Invalidates cache before each check to ensure fresh data
- Verifies ACL is no longer present using exact string comparison
- Respects context cancellation for proper timeout handling

This ensures ACL deletion operations complete successfully and ACLs are
actually removed from Kafka before Terraform proceeds.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant