Skip to content

Commit

Permalink
Remove lease test and dead code (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
louiseschmidtgen authored Sep 4, 2024
1 parent 358d1f0 commit 06d0fa2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
27 changes: 0 additions & 27 deletions test/lease_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,30 +79,3 @@ func TestLease(t *testing.T) {
})
}
}

// BenchmarkLease is a benchmark for the lease operation.
func BenchmarkLease(b *testing.B) {
for _, backendType := range []string{endpoint.SQLiteBackend, endpoint.DQLiteBackend} {
b.Run(backendType, func(b *testing.B) {
b.StopTimer()
g := NewWithT(b)

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

kine := newKineServer(ctx, b, &kineOptions{backendType: backendType})

kine.ResetMetrics()
b.StartTimer()
for i := 0; i < b.N; i++ {
var ttl int64 = int64(i + 1)
resp, err := kine.client.Lease.Grant(ctx, ttl)

g.Expect(err).To(BeNil())
g.Expect(resp.ID).To(Equal(clientv3.LeaseID(ttl)))
g.Expect(resp.TTL).To(Equal(ttl))
}
kine.ReportMetrics(b)
})
}
}
9 changes: 0 additions & 9 deletions test/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,6 @@ func BenchmarkUpdate(b *testing.B) {
}
}

func updateKey(ctx context.Context, g Gomega, client *clientv3.Client, key string, value string) {
resp, err := client.Get(ctx, key, clientv3.WithRange(""))

g.Expect(err).To(BeNil())
g.Expect(resp.Kvs).To(HaveLen(1))

updateRev(ctx, g, client, key, resp.Kvs[0].ModRevision, value)
}

func updateRev(ctx context.Context, g Gomega, client *clientv3.Client, key string, revision int64, value string) int64 {
resp, err := client.Txn(ctx).
If(clientv3.Compare(clientv3.ModRevision(key), "=", revision)).
Expand Down

0 comments on commit 06d0fa2

Please sign in to comment.