forked from etcd-io/etcd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
integration: test mvcc db size metric is set on restore
- Loading branch information
Anthony Romano
committed
Jun 16, 2017
1 parent
1acc809
commit a825709
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2017 The etcd Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package integration | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/coreos/etcd/pkg/testutil" | ||
) | ||
|
||
// TestMetricDbSize checks that the db size metric is set on boot. | ||
func TestMetricDbSize(t *testing.T) { | ||
defer testutil.AfterTest(t) | ||
clus := NewClusterV3(t, &ClusterConfig{Size: 1}) | ||
defer clus.Terminate(t) | ||
|
||
v, err := clus.Members[0].Metric("etcd_debugging_mvcc_db_total_size_in_bytes") | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
|
||
if v == "0" { | ||
t.Fatalf("expected non-zero, got %q", v) | ||
} | ||
} |