wilfred-s commented on a change in pull request #251:
URL: 
https://github.com/apache/incubator-yunikorn-core/pull/251#discussion_r583266255



##########
File path: pkg/scheduler/partition_test.go
##########
@@ -1221,3 +1222,237 @@ func TestUpdateNode(t *testing.T) {
                t.Errorf("Expected partition resource %s, doesn't match with 
actual partition resource %s", expectedRes, 
partition.GetTotalPartitionResource())
        }
 }
+
+func TestAddTGApplication(t *testing.T) {
+       limit := map[string]string{"first": "1"}
+       partition, err := newLimitedPartition(limit)
+       assert.NilError(t, err, "partition create failed")
+       // add a app with TG that does not fit in the queue
+       var tgRes *resources.Resource
+       tgRes, err = resources.NewResourceFromConf(map[string]string{"first": 
"10"})
+       assert.NilError(t, err, "failed to create resource")
+       app := newApplicationTG(appID1, "default", "root.limited", tgRes)
+       err = partition.AddApplication(app)
+       if err == nil {
+               t.Error("app-1 should be rejected due to TG request")
+       }
+
+       limit = map[string]string{"first": "100"}
+       partition, err = newLimitedPartition(limit)
+       assert.NilError(t, err, "partition create failed")
+       err = partition.AddApplication(app)
+       assert.NilError(t, err, "app-1 should have been added to the partition")

Review comment:
       done




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to