This is an automated email from the ASF dual-hosted git repository.

chia7712 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-k8shim.git


The following commit(s) were added to refs/heads/master by this push:
     new c5c12937 [YUNIKORN-2695] remove core dependency pkg/common (#868)
c5c12937 is described below

commit c5c1293764fb846eed12ef75ee8df64fa730f7e8
Author: lai0418 <91238486+lai0...@users.noreply.github.com>
AuthorDate: Fri Jul 5 00:50:25 2024 +0800

    [YUNIKORN-2695] remove core dependency pkg/common (#868)
    
    Closes: #868
    
    Signed-off-by: Chia-Ping Tsai <chia7...@gmail.com>
---
 pkg/cache/task_test.go     | 12 ++++++++----
 pkg/client/clients_test.go | 10 +++++-----
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/pkg/cache/task_test.go b/pkg/cache/task_test.go
index a74983b3..41cebf79 100644
--- a/pkg/cache/task_test.go
+++ b/pkg/cache/task_test.go
@@ -30,10 +30,10 @@ import (
        metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
        k8sEvents "k8s.io/client-go/tools/events"
 
-       "github.com/apache/yunikorn-core/pkg/common"
        "github.com/apache/yunikorn-k8shim/pkg/client"
        "github.com/apache/yunikorn-k8shim/pkg/common/constants"
        "github.com/apache/yunikorn-k8shim/pkg/common/events"
+       "github.com/apache/yunikorn-k8shim/pkg/common/utils"
        "github.com/apache/yunikorn-k8shim/pkg/conf"
        "github.com/apache/yunikorn-k8shim/pkg/locking"
 
@@ -200,9 +200,13 @@ func TestReleaseTaskAllocation(t *testing.T) {
        assert.NilError(t, err, "failed to handle AllocateTask event")
        assert.Equal(t, task.GetTaskState(), TaskStates().Allocated)
        // bind a task is a async process, wait for it to happen
-       err = common.WaitForCondition(100*time.Millisecond, 3*time.Second, 
func() bool {
-               return task.getNodeName() == "node-1"
-       })
+       err = utils.WaitForCondition(
+               func() bool {
+                       return task.getNodeName() == "node-1"
+               },
+               100*time.Millisecond,
+               3*time.Second,
+       )
        assert.NilError(t, err, "failed to wait for allocation allocationKey 
being set for task")
 
        // bound
diff --git a/pkg/client/clients_test.go b/pkg/client/clients_test.go
index 368dfac6..b29e4097 100644
--- a/pkg/client/clients_test.go
+++ b/pkg/client/clients_test.go
@@ -24,8 +24,8 @@ import (
 
        "gotest.tools/v3/assert"
 
-       "github.com/apache/yunikorn-core/pkg/common"
        "github.com/apache/yunikorn-k8shim/pkg/common/test"
+       "github.com/apache/yunikorn-k8shim/pkg/common/utils"
 )
 
 const (
@@ -58,16 +58,16 @@ func TestRun(t *testing.T) {
        }()
 
        clients.Run(stop)
-       err := common.WaitForCondition(10*time.Millisecond, time.Second, func() 
bool {
+       err := utils.WaitForCondition(func() bool {
                return test.RunningInformers.Load() == noOfInformers
-       })
+       }, 10*time.Millisecond, time.Second)
        assert.NilError(t, err, "number of running informers: expected %d got 
%d", noOfInformers, test.RunningInformers.Load())
 
        close(stop)
        stopped = true
-       err = common.WaitForCondition(10*time.Millisecond, time.Second, func() 
bool {
+       err = utils.WaitForCondition(func() bool {
                return test.RunningInformers.Load() == 0
-       })
+       }, 10*time.Millisecond, time.Second)
        assert.NilError(t, err, "no. of informers still running: %d", 
test.RunningInformers.Load())
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@yunikorn.apache.org
For additional commands, e-mail: issues-h...@yunikorn.apache.org

Reply via email to