Skip to content

Comments

Attempt to fix acl tests#555

Merged
Mongey merged 8 commits intomainfrom
cm/claude
Jul 8, 2025
Merged

Attempt to fix acl tests#555
Mongey merged 8 commits intomainfrom
cm/claude

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 8 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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
@Mongey Mongey marked this pull request as ready for review July 8, 2025 11:31
@Mongey Mongey merged commit 0eb5e26 into main Jul 8, 2025
4 checks passed
@Mongey Mongey deleted the cm/claude branch July 8, 2025 11:33
@slachiewicz
Copy link
Contributor

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.

2 participants