Skip to content

Commit

Permalink
Added e2e for remote Data node #3
Browse files Browse the repository at this point in the history
  • Loading branch information
qurname2 committed Sep 2, 2024
1 parent a21137a commit 3aebd52
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions test/e2e/ytsaurus_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ import (
"go.ytsaurus.tech/yt/go/mapreduce/spec"
"go.ytsaurus.tech/yt/go/yt/ytrpc"
"go.ytsaurus.tech/yt/go/yterrors"
apierrors "k8s.io/apimachinery/pkg/api/errors"

corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"

Expand Down Expand Up @@ -790,9 +789,8 @@ var _ = Describe("Basic test for Ytsaurus controller", func() {

namespace := "remotedata"

ytsaurus := testutil.CreateBaseYtsaurusResource(namespace)
// Ensure that no local data nodes exist, only remote ones (which will be created later).
ytsaurus.Spec.DataNodes = []ytv1.DataNodesSpec{}
// We have to create only the minimal YT - with master and discovery servers
ytsaurus := testutil.CreateMinimalYtsaurusResource(namespace)
g := ytconfig.NewGenerator(ytsaurus, "local")

remoteYtsaurus := &ytv1.RemoteYtsaurus{
Expand Down Expand Up @@ -820,7 +818,7 @@ var _ = Describe("Basic test for Ytsaurus controller", func() {
CoreImage: testutil.CoreImageFirst,
},
DataNodesSpec: ytv1.DataNodesSpec{
InstanceSpec: testutil.CreateDataNodeInstanceSpec(1),
InstanceSpec: testutil.CreateDataNodeInstanceSpec(3),
},
},
}
Expand All @@ -837,16 +835,16 @@ var _ = Describe("Basic test for Ytsaurus controller", func() {
By("Creating ytsaurus client")
ytClient := getYtClient(g, namespace)

By("Create a chunk")
_, err := ytClient.CreateNode(ctx, ypath.Path("//tmp/a"), yt.NodeTable, nil)
Expect(err).Should(Succeed())
By("Create a chunk on a remote data node")
_, errCreateNode := ytClient.CreateNode(ctx, ypath.Path("//tmp/a"), yt.NodeTable, &yt.CreateNodeOptions{})
Expect(errCreateNode).Should(Succeed())

// Eventually(func(g Gomega) {
// writer, err := ytClient.WriteTable(ctx, ypath.Path("//tmp/a"), nil)
// g.Expect(err).ShouldNot(HaveOccurred())
// g.Expect(writer.Write(testRow{A: "123"})).Should(Succeed())
// g.Expect(writer.Commit()).Should(Succeed())
//}, reactionTimeout, pollInterval).Should(Succeed())
Eventually(func(g Gomega) {
writer, err := ytClient.WriteTable(ctx, ypath.Path("//tmp/a"), nil)
g.Expect(err).ShouldNot(HaveOccurred())
g.Expect(writer.Write(testRow{A: "123"})).Should(Succeed())
g.Expect(writer.Commit()).Should(Succeed())
}, reactionTimeout, pollInterval).Should(Succeed())
})
It(
"Rpc proxies should require authentication",
Expand Down

0 comments on commit 3aebd52

Please sign in to comment.