Skip to content

Commit 9e91bf8

Browse files
committed
Responses to feedback, including making testStdinPipe helper log details of errors copying data to stdin.
Note: We cannot call t.Fatal from a non-test goroutine.
1 parent fa5fdc1 commit 9e91bf8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

internal/command/command_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,11 @@ func testStdinPipe(t *testing.T, src io.Reader) func() {
657657
// Copy the data from the reader to the pipe
658658
go func() {
659659
defer w.Close()
660-
io.Copy(w, src)
660+
_, err := io.Copy(w, src)
661+
if err != nil {
662+
t.Logf("error when copying data from testStdinPipe reader argument to stdin: %s", err)
663+
t.Fail()
664+
}
661665
}()
662666

663667
return func() {

internal/command/meta_backend.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1862,7 +1862,7 @@ func (m *Meta) createDefaultWorkspace(c *configs.StateStore, b backend.Backend)
18621862
defaultSMgr, sDiags := b.StateMgr(backend.DefaultStateName)
18631863
diags = diags.Append(sDiags)
18641864
if sDiags.HasErrors() {
1865-
diags = diags.Append(fmt.Errorf("Failed to create a state manager for state store %q in provider %s (%q). This is a bug in Terraform and should be reported: %w",
1865+
diags = diags.Append(fmt.Errorf("Failed to create a state manager for state store %q in provider %s (%q). This is a bug in Terraform and should be reported: %w",
18661866
c.Type,
18671867
c.Provider.Name,
18681868
c.ProviderAddr,

0 commit comments

Comments
 (0)