etcdserver: Implement running defrag if freeable space will exceed privided threshold

This commit is contained in:
Marek Siarkowicz
2021-05-10 13:50:09 +02:00
parent 5bad818c70
commit efc8505739
7 changed files with 52 additions and 0 deletions

View File

@@ -319,3 +319,18 @@ func TestGrpcproxyAndCommonName(t *testing.T) {
t.Fatal(err)
}
}
func TestBootstrapDefragFlag(t *testing.T) {
skipInShortMode(t)
proc, err := spawnCmd([]string{binDir + "/etcd", "--experimental-bootstrap-defrag-threshold-megabytes", "1000"})
if err != nil {
t.Fatal(err)
}
if err = waitReadyExpectProc(proc, []string{"Skipping defragmentation"}); err != nil {
t.Fatal(err)
}
if err = proc.Stop(); err != nil {
t.Fatal(err)
}
}