Skip to content
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

data-source/external: Use ReadWithoutTimeout instead of ReadContext #165

Merged
merged 1 commit into from
Oct 25, 2022

Conversation

bflad
Copy link
Member

@bflad bflad commented Oct 17, 2022

Closes #164

Proposed CHANGELOG entry:

data-source/external: Prevented unexpected error after 20 minutes of program execution

The additional acceptance test is placed behind an environment variable flag since it is extremely long running compared to other testing.

Without the flag:

$ TF_ACC=1 go test -count=1 -run='TestDataSource_20MinuteTimeout' -v ./internal/provider
=== RUN   TestDataSource_20MinuteTimeout
    data_source_test.go:197: Skipping this test since the TF_ACC_EXTERNAL_TIMEOUT_TEST environment variable is not set to any value. This test requires 20 minutes to run, so it is disabled by default.
--- SKIP: TestDataSource_20MinuteTimeout (0.00s)
PASS
ok      github.com/terraform-providers/terraform-provider-external/internal/provider    0.982s

With the flag:

$ TF_ACC=1 TF_ACC_EXTERNAL_TIMEOUT_TEST=1 go test -count=1 -run='TestDataSource_20MinuteTimeout' -timeout=30m -v ./internal/provider
=== RUN   TestDataSource_20MinuteTimeout
--- PASS: TestDataSource_20MinuteTimeout (1205.18s)
PASS
ok      github.com/terraform-providers/terraform-provider-external/internal/provider    1205.465s

Reference: #164

Proposed CHANGELOG entry:

```
data-source/external: Prevented unexpected error after 20 minutes of program execution
```

The additional acceptance test is placed behind an environment variable flag since it is extremely long running compared to other testing.

Without the flag:

```console
$ TF_ACC=1 go test -count=1 -run='TestDataSource_20MinuteTimeout' -v ./internal/provider
=== RUN   TestDataSource_20MinuteTimeout
    data_source_test.go:197: Skipping this test since the TF_ACC_EXTERNAL_TIMEOUT_TEST environment variable is not set to any value. This test requires 20 minutes to run, so it is disabled by default.
--- SKIP: TestDataSource_20MinuteTimeout (0.00s)
PASS
ok      github.com/terraform-providers/terraform-provider-external/internal/provider    0.982s
```

With the flag:

```console
$ TF_ACC=1 TF_ACC_EXTERNAL_TIMEOUT_TEST=1 go test -count=1 -run='TestDataSource_20MinuteTimeout' -timeout=30m -v ./internal/provider
=== RUN   TestDataSource_20MinuteTimeout
--- PASS: TestDataSource_20MinuteTimeout (1205.18s)
PASS
ok      github.com/terraform-providers/terraform-provider-external/internal/provider    1205.465s
```
@bflad bflad added the bug label Oct 17, 2022
@bflad bflad requested a review from a team as a code owner October 17, 2022 20:48
Copy link
Contributor

@bendbennett bendbennett left a comment

Choose a reason for hiding this comment

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

LGTM

@bflad bflad added this to the v2.2.3 milestone Oct 25, 2022
@bflad bflad merged commit e7f2f96 into main Oct 25, 2022
@bflad bflad deleted the bflad/ReadWithoutTimeout branch October 25, 2022 13:03
bflad added a commit that referenced this pull request Oct 25, 2022
Copy link
Contributor

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 May 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Long running external program always fails
3 participants