Peter Bacsko created YUNIKORN-1730:
--------------------------------------

             Summary: TestTryAllocatePreemptNode passes by accident
                 Key: YUNIKORN-1730
                 URL: https://issues.apache.org/jira/browse/YUNIKORN-1730
             Project: Apache YuniKorn
          Issue Type: Bug
          Components: core - scheduler, test - unit
            Reporter: Peter Bacsko


The unit test TestTryAllocatePreemptNode passes but does dot not things 
properly.

Both iterator that is passed to the {{tryAllocate()}} are full iterators and 
two reservation occurs:
{noformat}
2023-05-10T16:01:47.505+0200    DEBUG   objects/application.go:1391     app 
reservation check   {"allocationKey": "alloc3", "createTime": 
"2023-05-10T16:01:37.503+0200", "askAge": "10.002078359s", "reservationDelay": 
"2s"}
2023-05-10T16:01:47.506+0200    DEBUG   objects/application.go:1391     app 
reservation check   {"allocationKey": "alloc3", "createTime": 
"2023-05-10T16:01:37.503+0200", "askAge": "10.002117507s", "reservationDelay": 
"2s"}
2023-05-10T16:01:47.506+0200    DEBUG   objects/application.go:1407     found 
candidate node for app reservation        {"appID": "app-2", "nodeID": "node1", 
"allocationKey": "alloc3", "reservations": 0, "pendingRepeats": 1}
2023-05-10T16:01:47.506+0200    DEBUG   objects/application.go:1391     app 
reservation check   {"allocationKey": "alloc3", "createTime": 
"2023-05-10T16:01:07.503+0200", "askAge": "40.002152549s", "reservationDelay": 
"2s"}
2023-05-10T16:01:47.506+0200    DEBUG   objects/application.go:1391     app 
reservation check   {"allocationKey": "alloc3", "createTime": 
"2023-05-10T16:01:07.503+0200", "askAge": "40.002165214s", "reservationDelay": 
"2s"}
2023-05-10T16:01:47.506+0200    DEBUG   objects/preemption.go:345       No RM 
callback plugin registered, using first selected node for preemption      
{"NodeID": "node1", "AllocationKey": "alloc3"}
2023-05-10T16:01:47.506+0200    INFO    objects/preemption.go:545       
Preempting task {"applicationID": "app-1", "allocationKey": "alloc1", "nodeID": 
"node1", "resources": "map[first:5]"}
2023-05-10T16:01:47.506+0200    INFO    objects/preemption.go:566       
Reserving node for ask after preemption {"allocationKey": "alloc3", "nodeID": 
"node1", "victimCount": 1}
{noformat}

With modifying the full iterator to return only unreserved nodes, we'll have no 
preemption:
{noformat}
2023-05-10T16:03:09.605+0200    DEBUG   objects/application.go:1391     app 
reservation check   {"allocationKey": "alloc3", "createTime": 
"2023-05-10T16:02:59.605+0200", "askAge": "10.000480105s", "reservationDelay": 
"2s"}
2023-05-10T16:03:09.605+0200    DEBUG   objects/application.go:1391     app 
reservation check   {"allocationKey": "alloc3", "createTime": 
"2023-05-10T16:02:59.605+0200", "askAge": "10.000499502s", "reservationDelay": 
"2s"}
2023-05-10T16:03:09.605+0200    DEBUG   objects/application.go:1407     found 
candidate node for app reservation        {"appID": "app-2", "nodeID": "node1", 
"allocationKey": "alloc3", "reservations": 0, "pendingRepeats": 1}
2023-05-10T16:03:09.605+0200    DEBUG   objects/application.go:1391     app 
reservation check   {"allocationKey": "alloc3", "createTime": 
"2023-05-10T16:02:29.605+0200", "askAge": "40.000538123s", "reservationDelay": 
"2s"}
2023-05-10T16:03:09.605+0200    DEBUG   objects/application.go:1407     found 
candidate node for app reservation        {"appID": "app-2", "nodeID": "node2", 
"allocationKey": "alloc3", "reservations": 0, "pendingRepeats": 1}
    application_test.go:1795: assertion failed: expression is false: 
alloc1.IsPreempted(): alloc1 should have been preempted
--- FAIL: TestTryAllocatePreemptNode (0.01s)
{noformat}

Note that this is not the only testcase where both iterators are full, but this 
seems to be only one which actually fails when the iterator is fixed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to