mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
cloud: when saving state, create a pending state version then upload
Create a pending state version followed by a separate state upload When this version of the endpoint fails (It is not yet generally available, or when using with Terraform Enterprise) Fall back to the original call with state content included in the request. This strategy will reduce the amount of save failures due to network latency and gateway timeouts.
This commit is contained in:
@@ -298,7 +298,6 @@ func TestState_PersistState(t *testing.T) {
|
||||
// since HTTP-level concerns like headers are out of scope for the
|
||||
// mock client we typically use in other tests in this package, which
|
||||
// aim to abstract away HTTP altogether.
|
||||
var serverURL string
|
||||
|
||||
// Didn't want to repeat myself here
|
||||
for _, testCase := range []struct {
|
||||
@@ -314,10 +313,9 @@ func TestState_PersistState(t *testing.T) {
|
||||
snapshotsEnabled: false,
|
||||
},
|
||||
} {
|
||||
server := testServerWithSnapshotsEnabled(t, serverURL, testCase.snapshotsEnabled)
|
||||
server := testServerWithSnapshotsEnabled(t, testCase.snapshotsEnabled)
|
||||
|
||||
defer server.Close()
|
||||
serverURL = server.URL
|
||||
cfg := &tfe.Config{
|
||||
Address: server.URL,
|
||||
BasePath: "api",
|
||||
|
||||
Reference in New Issue
Block a user