mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-14 02:32:39 -06:00
Add test for storing state just under the size limit of the Consul backend
Storing a state just a bit smaller than the limit of the KV API fails because we are using the Transaction API which has an overhead.
This commit is contained in:
parent
abf7f3416b
commit
e5fb84a01a
@ -136,11 +136,6 @@ func TestConsul_largeState(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// md5 := md5.Sum(payload)
|
|
||||||
// if !bytes.Equal(md5[:], remote.MD5) {
|
|
||||||
// t.Fatal("the md5 sums do not match")
|
|
||||||
// }
|
|
||||||
|
|
||||||
if !bytes.Equal(payload, remote.Data) {
|
if !bytes.Equal(payload, remote.Data) {
|
||||||
t.Fatal("the data do not match")
|
t.Fatal("the data do not match")
|
||||||
}
|
}
|
||||||
@ -161,6 +156,19 @@ func TestConsul_largeState(t *testing.T) {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// This payload is just short enough to be stored but will be bigger when
|
||||||
|
// going through the Transaction API as it will be base64 encoded
|
||||||
|
testPayload(
|
||||||
|
t,
|
||||||
|
map[string]string{
|
||||||
|
"foo": strings.Repeat("a", 524288-10),
|
||||||
|
},
|
||||||
|
[]string{
|
||||||
|
"tf-unit/test-large-state",
|
||||||
|
"tf-unit/test-large-state/tfstate.4f407ace136a86521fd0d366972fe5c7/0",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
// We try to replace the payload with a small one, the old chunks should be removed
|
// We try to replace the payload with a small one, the old chunks should be removed
|
||||||
testPayload(
|
testPayload(
|
||||||
t,
|
t,
|
||||||
|
Loading…
Reference in New Issue
Block a user