Skip to content

tf test: parallelize teardown operations#37169

Closed
dsa0x wants to merge 5 commits intomainfrom
sams/parallel-cleanup
Closed

tf test: parallelize teardown operations#37169
dsa0x wants to merge 5 commits intomainfrom
sams/parallel-cleanup

Conversation

@dsa0x
Copy link
Copy Markdown
Member

@dsa0x dsa0x commented May 26, 2025

Fixes #

Target Release

1.13.x

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

@dsa0x dsa0x force-pushed the sams/parallel-cleanup branch from 77aa06b to 71752f5 Compare May 26, 2025 13:27
sync.Mutex

// NoLock is used to disable locking in the mock provider.
NoLock bool
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, this didn't occur to me before. Would it work just to have a test that uses two (or more) separate provider instances so they don't share the mutex under the hood anyway? This would be instead of giving the option to disable the locking.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test runs share the same configuration, and I am not sure how would then differentiate the instance they should use.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can specify the provider for each run block:

provider "test" {
  alias = "one"
}

provider "test" {
  alias = "two"
}

run "one" {
  providers = {
    test = test.one
  }
}

run "two" {
  providers = {
    test = test.two
  }
}

Then the run blocks will use different provider instances, and they should be able to parallelise?

Copy link
Copy Markdown
Member Author

@dsa0x dsa0x May 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good point. I had forgotten that feature was available in the test framework. That could be a solid approach.

I will check if that alias translates to the test provider somehow. Otherwise, we might still be using the same concrete struct.

@dsa0x
Copy link
Copy Markdown
Member Author

dsa0x commented Jun 6, 2025

@dsa0x dsa0x closed this Jun 6, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 7, 2025

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants