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)
|
||||
}
|
||||
|
||||
// md5 := md5.Sum(payload)
|
||||
// if !bytes.Equal(md5[:], remote.MD5) {
|
||||
// t.Fatal("the md5 sums do not match")
|
||||
// }
|
||||
|
||||
if !bytes.Equal(payload, remote.Data) {
|
||||
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
|
||||
testPayload(
|
||||
t,
|
||||
|
|
Loading…
Reference in New Issue