[
https://issues.apache.org/jira/browse/YUNIKORN-2127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Craig Condit closed YUNIKORN-2127.
----------------------------------
> stateAwareFilter doesn't work as description
> --------------------------------------------
>
> Key: YUNIKORN-2127
> URL: https://issues.apache.org/jira/browse/YUNIKORN-2127
> Project: Apache YuniKorn
> Issue Type: Improvement
> Components: core - scheduler
> Reporter: PoAn Yang
> Assignee: PoAn Yang
> Priority: Major
> Labels: pull-request-available
>
> In stateAwareFilter description, it only allows one (1) application with a
> state that is not running in the list of candidates. The non-running state
> can be Starting or Accepted. However, in the following case, the last
> assertion cannot pass, because the result of candidate list is [appID0,
> appID1, appID2, appID3]. We should either update the description or fix the
> function.
>
> {noformat}
> func TestStateAwareFilter(t *testing.T) {
> // stable sort is used so equal values stay where they were
> res := resources.NewResourceFromMap(map[string]resources.Quantity{
> "vcore": resources.Quantity(100)})
> // setup all apps with pending resources, all accepted state
> input := make(map[string]*Application, 4)
> for i := 0; i < 4; i++ {
> num := strconv.Itoa(i)
> appID := "app-" + num
> app := newApplication(appID, "partition", "queue")
> app.pending = res
> input[appID] = app
> err := app.HandleApplicationEvent(RunApplication) // change app state
> from New to Accepted
> assert.NilError(t, err, "state change failed for app %v", appID)
> err = app.HandleApplicationEvent(RunApplication) // change app state
> from Accepted to Starting
> assert.NilError(t, err, "state change failed for app %v", appID)
> // make sure the time stamps differ at least a bit (tracking in nano
> seconds)
> time.Sleep(time.Nanosecond * 5)
> }
> list := sortApplications(input, policies.StateAwarePolicy, false, nil)
> assertAppListLength(t, list, []string{appID0}, "should only have one
> starting app") // this will fail
> }{noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]