"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "integration/v3_alarm_test.go" between
etcd-3.4.1.tar.gz and etcd-3.4.2.tar.gz

About: etcd is a distributed reliable key-value store for the most critical data of a distributed system (written in "Go").

v3_alarm_test.go  (etcd-3.4.1):v3_alarm_test.go  (etcd-3.4.2)
skipping to change at line 30 skipping to change at line 30
"path/filepath" "path/filepath"
"sync" "sync"
"testing" "testing"
"time" "time"
"go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes"
pb "go.etcd.io/etcd/etcdserver/etcdserverpb" pb "go.etcd.io/etcd/etcdserver/etcdserverpb"
"go.etcd.io/etcd/mvcc" "go.etcd.io/etcd/mvcc"
"go.etcd.io/etcd/mvcc/backend" "go.etcd.io/etcd/mvcc/backend"
"go.etcd.io/etcd/pkg/testutil" "go.etcd.io/etcd/pkg/testutil"
"go.etcd.io/etcd/pkg/traceutil"
"go.uber.org/zap" "go.uber.org/zap"
) )
// TestV3StorageQuotaApply tests the V3 server respects quotas during apply // TestV3StorageQuotaApply tests the V3 server respects quotas during apply
func TestV3StorageQuotaApply(t *testing.T) { func TestV3StorageQuotaApply(t *testing.T) {
testutil.AfterTest(t) testutil.AfterTest(t)
quotasize := int64(16 * os.Getpagesize()) quotasize := int64(16 * os.Getpagesize())
clus := NewClusterV3(t, &ClusterConfig{Size: 2}) clus := NewClusterV3(t, &ClusterConfig{Size: 2})
skipping to change at line 176 skipping to change at line 177
wg.Wait() wg.Wait()
// Corrupt member 0 by modifying backend offline. // Corrupt member 0 by modifying backend offline.
clus.Members[0].Stop(t) clus.Members[0].Stop(t)
fp := filepath.Join(clus.Members[0].DataDir, "member", "snap", "db") fp := filepath.Join(clus.Members[0].DataDir, "member", "snap", "db")
be := backend.NewDefaultBackend(fp) be := backend.NewDefaultBackend(fp)
s := mvcc.NewStore(zap.NewExample(), be, nil, &fakeConsistentIndex{13}, m vcc.StoreConfig{}) s := mvcc.NewStore(zap.NewExample(), be, nil, &fakeConsistentIndex{13}, m vcc.StoreConfig{})
// NOTE: cluster_proxy mode with namespacing won't set 'k', but namespace /'k'. // NOTE: cluster_proxy mode with namespacing won't set 'k', but namespace /'k'.
s.Put([]byte("abc"), []byte("def"), 0) s.Put([]byte("abc"), []byte("def"), 0)
s.Put([]byte("xyz"), []byte("123"), 0) s.Put([]byte("xyz"), []byte("123"), 0)
s.Compact(5) s.Compact(traceutil.TODO(), 5)
s.Commit() s.Commit()
s.Close() s.Close()
be.Close() be.Close()
clus.Members[1].WaitOK(t) clus.Members[1].WaitOK(t)
clus.Members[2].WaitOK(t) clus.Members[2].WaitOK(t)
time.Sleep(time.Second * 2) time.Sleep(time.Second * 2)
// Wait for cluster so Puts succeed in case member 0 was the leader. // Wait for cluster so Puts succeed in case member 0 was the leader.
if _, err := clus.Client(1).Get(context.TODO(), "k"); err != nil { if _, err := clus.Client(1).Get(context.TODO(), "k"); err != nil {
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)