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

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


The following commit(s) were added to refs/heads/master by this push:
     new 66e20721 [YUNIKORN-2647] Flaky test TestUpdateNodeCapacity (#884)
66e20721 is described below

commit 66e207215b6f078df2277aba884c915260808435
Author: Tseng Hsi-Huang <[email protected]>
AuthorDate: Tue Jun 4 10:48:48 2024 +0200

    [YUNIKORN-2647] Flaky test TestUpdateNodeCapacity (#884)
    
    Closes: #884
    
    Signed-off-by: Peter Bacsko <[email protected]>
---
 pkg/scheduler/tests/operation_test.go | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/pkg/scheduler/tests/operation_test.go 
b/pkg/scheduler/tests/operation_test.go
index 0337ac89..2fbd3b68 100644
--- a/pkg/scheduler/tests/operation_test.go
+++ b/pkg/scheduler/tests/operation_test.go
@@ -408,15 +408,14 @@ partitions:
 
        assert.NilError(t, err, "NodeRequest failed")
        waitForAvailableNodeResource(t, ms.scheduler.GetClusterContext(), 
"[rm:123]default", []string{"node-1:1234"}, 300000000, 1000)
+       waitForUpdatePartitionResource(t, partitionInfo, common.Memory, 
300000000, 1000)
+       waitForUpdatePartitionResource(t, partitionInfo, common.CPU, 10000, 
1000)
        assert.Equal(t, int64(node1.GetCapacity().Resources[common.Memory]), 
int64(300000000))
        assert.Equal(t, int64(node1.GetCapacity().Resources[common.CPU]), 
int64(10000))
        assert.Equal(t, 
int64(schedulingNode1.GetAllocatedResource().Resources[common.Memory]), 
int64(0))
        assert.Equal(t, 
int64(schedulingNode1.GetAvailableResource().Resources[common.Memory]), 
int64(300000000))
        newRes, err := 
resources.NewResourceFromConf(map[string]string{"memory": "300M", "vcore": 
"10"})
        assert.NilError(t, err, "failed to create resource")
-       if !resources.Equals(newRes, partitionInfo.GetTotalPartitionResource()) 
{
-               t.Errorf("Expected partition resource %s, doesn't match with 
actual partition resource %s", newRes, 
partitionInfo.GetTotalPartitionResource())
-       }
        if !resources.Equals(newRes, 
partitionInfo.GetQueue("root").GetMaxResource()) {
                t.Errorf("Expected partition resource %s, doesn't match with 
actual partition resource %s", newRes, 
partitionInfo.GetQueue("root").GetMaxResource())
        }
@@ -440,11 +439,10 @@ partitions:
        })
        assert.NilError(t, err, "NodeRequest failed")
        waitForAvailableNodeResource(t, ms.scheduler.GetClusterContext(), 
"[rm:123]default", []string{"node-1:1234"}, 100000000, 1000)
+       waitForUpdatePartitionResource(t, partitionInfo, common.Memory, 
100000000, 1000)
+       waitForUpdatePartitionResource(t, partitionInfo, common.CPU, 20000, 
1000)
        newRes, err = resources.NewResourceFromConf(map[string]string{"memory": 
"100M", "vcore": "20"})
        assert.NilError(t, err, "failed to create resource")
-       if !resources.Equals(newRes, partitionInfo.GetTotalPartitionResource()) 
{
-               t.Errorf("Expected partition resource %s, doesn't match with 
actual partition resource %s", newRes, 
partitionInfo.GetTotalPartitionResource())
-       }
        if !resources.Equals(newRes, 
partitionInfo.GetQueue("root").GetMaxResource()) {
                t.Errorf("Expected partition resource %s, doesn't match with 
actual partition resource %s", newRes, 
partitionInfo.GetQueue("root").GetMaxResource())
        }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to