Uploaded image for project: 'Apache YuniKorn'
  1. Apache YuniKorn
  2. YUNIKORN-1730

TestTryAllocatePreemptNode passes by accident

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • None

    Description

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

      Both iterator that is passed to the tryAllocate() are full iterators:

      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}
      

      With modifying the first iterator to return only unreserved nodes, we'll have no preemption:

      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)
      

      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.

      Attachments

        Activity

          People

            ccondit Craig Condit
            pbacsko Peter Bacsko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: