logical/framework: only rollback old enough WAL entries

This commit is contained in:
Mitchell Hashimoto
2015-03-17 17:58:05 -07:00
parent 93f828ec0d
commit 56fb620b2d
4 changed files with 59 additions and 25 deletions

View File

@@ -4,6 +4,7 @@ import (
"reflect"
"sync/atomic"
"testing"
"time"
"github.com/hashicorp/vault/logical"
)
@@ -147,7 +148,8 @@ func TestBackendHandleRequest_rollback(t *testing.T) {
}
b := &Backend{
Rollback: callback,
Rollback: callback,
RollbackMinAge: 1 * time.Millisecond,
}
storage := new(logical.InmemStorage)
@@ -155,6 +157,8 @@ func TestBackendHandleRequest_rollback(t *testing.T) {
t.Fatalf("err: %s", err)
}
time.Sleep(10 * time.Millisecond)
_, err := b.HandleRequest(&logical.Request{
Operation: logical.RollbackOperation,
Path: "",