Repository: kubernetes-sigs/kueue
Pull request #257 (2022-05-10 14:03:41)

do workload.NewInfo when inserting and updating
<!--  Thanks for sending a pull request!  Here are some tips for you:

1. If this is your first time, please read our contributor guidelines: https://git.k8s.io/community/contributors/guide/first-contribution.md#your-first-contribution and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. For reference on required PR/issue labels, read here:
https://git.k8s.io/community/contributors/devel/sig-release/release.md#issuepr-kind-label
3. Ensure you have added or ran the appropriate tests for your PR: https://git.k8s.io/community/contributors/devel/sig-testing/testing.md
4. If you want *faster* PR reviews, read how: https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews
5. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests
-->

#### What type of PR is this?
/kind cleanup
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature

Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

#### What this PR does / why we need it:
call `NewInfo` in `manager.go` to improve the performance.
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->
ref: https://github.com/kubernetes-sigs/kueue/issues/162
#### Special notes for your reviewer:



k8s-ci-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes-sigs/kueue/pull/257#" title="Author self-approved">cmssczy</a>*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alculquicondor** after the PR has been reviewed.
You can assign the PR to them by writing `/assign @alculquicondor` in a comment when ready.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Fkueue).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/kubernetes-sigs/kueue/blob/main/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["alculquicondor"]} -->
k8s-ci-robot: @cmssczy: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-kueue-test-unit-main | 57cbe5c9160146ecfd5730a7d16a2e959bd51e1c | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/257/pull-kueue-test-unit-main/1524089411845754880) | true | `/test pull-kueue-test-unit-main`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=kueue&pr=257). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Acmssczy). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/kueue/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @cmssczy: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-kueue-verify-main | b0064bfbec80a1fffaedd302dd95a67bc840f013 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/257/pull-kueue-verify-main/1524558301373665280) | true | `/test pull-kueue-verify-main`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=kueue&pr=257). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Acmssczy). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/kueue/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @cmssczy: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-kueue-verify-main | b0064bfbec80a1fffaedd302dd95a67bc840f013 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/257/pull-kueue-verify-main/1524558301373665280) | true | `/test pull-kueue-verify-main`
pull-kueue-test-unit-main | b0064bfbec80a1fffaedd302dd95a67bc840f013 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/257/pull-kueue-test-unit-main/1524558301302362112) | true | `/test pull-kueue-test-unit-main`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=kueue&pr=257). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Acmssczy). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/kueue/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @cmssczy: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-kueue-verify-main | b0064bfbec80a1fffaedd302dd95a67bc840f013 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/257/pull-kueue-verify-main/1524558301373665280) | true | `/test pull-kueue-verify-main`
pull-kueue-test-unit-main | b0064bfbec80a1fffaedd302dd95a67bc840f013 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/257/pull-kueue-test-unit-main/1524558301302362112) | true | `/test pull-kueue-test-unit-main`
pull-kueue-test-integration-main | b0064bfbec80a1fffaedd302dd95a67bc840f013 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/257/pull-kueue-test-integration-main/1524558301335916544) | true | `/test pull-kueue-test-integration-main`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=kueue&pr=257). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Acmssczy). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/kueue/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
linux-foundation-easycla[bot]:  <a href="https://api.easycla.lfx.linuxfoundation.org/v2/repository-provider/github/sign/20677499/459870310/257/#/?version=2"><img src="https://s3.amazonaws.com/cla-project-logo-prod/cla-missing-id.svg" alt="CLA Missing ID" align="left" height="28" width="328"></a> <a href="https://api.easycla.lfx.linuxfoundation.org/v2/repository-provider/github/sign/20677499/459870310/257/#/?version=2"><img src="https://s3.amazonaws.com/cla-project-logo-prod/cla-not-signed.svg" alt="CLA Not Signed" align="left" height="28" width="328"></a><br/><br /><ul><li>:white_check_mark: login: cmssczy / name: cmssczy  (f654498838f8dba59f47f98c5daccf686901c6f7)</li><li> :x: The commit (a233e27616c4263cc3bbd168c73fd51ced92f159). This user is missing the User's ID, preventing the EasyCLA check. <a href='https://help.github.com/en/github/committing-changes-to-your-project/why-are-my-commits-linked-to-the-wrong-user' target='_blank'>Consult GitHub Help</a> to resolve.For further assistance with EasyCLA, <a href='https://jira.linuxfoundation.org/servicedesk/customer/portal/4' target='_blank'>please submit a support request ticket</a>.</li></ul>
denkensk: /approve
Please squash.
k8s-ci-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes-sigs/kueue/pull/257#" title="Author self-approved">cmssczy</a>*, *<a href="https://github.com/kubernetes-sigs/kueue/pull/257#issuecomment-1131504363" title="Approved">denkensk</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Fkueue).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/kubernetes-sigs/kueue/blob/main/OWNERS)~~ [denkensk]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->

Patch:
diff --git a/OWNERS b/OWNERS
index a1474fabe..680c47d72 100644
--- a/OWNERS
+++ b/OWNERS
@@ -4,7 +4,6 @@ approvers:
   - github-admin-team
   - ahg-g
   - alculquicondor
-  - denkensk
 
 reviewers:
   - ArangoGutierrez
diff --git a/main.go b/main.go
index fc7fe0469..2eddd4499 100644
--- a/main.go
+++ b/main.go
@@ -115,8 +115,8 @@ func main() {
 		setupLog.Error(err, "Unable to setup cache indexes")
 	}
 
+	queues := queue.NewManager(mgr.GetClient())
 	cCache := cache.New(mgr.GetClient())
-	queues := queue.NewManager(mgr.GetClient(), cCache)
 	if failedCtrl, err := core.SetupControllers(mgr, queues, cCache); err != nil {
 		setupLog.Error(err, "Unable to create controller", "controller", failedCtrl)
 	}
diff --git a/pkg/controller/core/resourceflavor_controller.go b/pkg/controller/core/resourceflavor_controller.go
index 9c4819756..402918c53 100644
--- a/pkg/controller/core/resourceflavor_controller.go
+++ b/pkg/controller/core/resourceflavor_controller.go
@@ -64,10 +64,6 @@ func (r *ResourceFlavorReconciler) Create(e event.CreateEvent) bool {
 	// we should inform clusterQueue controller to broadcast the event.
 	if cqNames := r.cache.AddOrUpdateResourceFlavor(flv.DeepCopy()); len(cqNames) > 0 {
 		r.qManager.QueueInadmissibleWorkloads(cqNames)
-		// If at least one CQ becomes active, then those CQs should now get evaluated by the scheduler;
-		// note that the workloads in those CQs are not necessarily "inadmissible", and hence we trigger a
-		// broadcast here in all cases.
-		r.qManager.Broadcast()
 	}
 	return false
 }
diff --git a/pkg/queue/cluster_queue_best_effort_fifo.go b/pkg/queue/cluster_queue_best_effort_fifo.go
index d49332a49..a1c088765 100644
--- a/pkg/queue/cluster_queue_best_effort_fifo.go
+++ b/pkg/queue/cluster_queue_best_effort_fifo.go
@@ -47,21 +47,21 @@ func newClusterQueueBestEffortFIFO(cq *kueue.ClusterQueue) (ClusterQueue, error)
 	return cqBE, nil
 }
 
-func (cq *ClusterQueueBestEffortFIFO) PushOrUpdate(w *kueue.Workload) {
-	key := workload.Key(w)
+func (cq *ClusterQueueBestEffortFIFO) PushOrUpdate(wInfo *workload.Info) {
+	key := workload.Key(wInfo.Obj)
 	oldInfo := cq.inadmissibleWorkloads[key]
 	if oldInfo != nil {
 		// update in place if the workload was inadmissible and didn't change
 		// to potentially become admissible.
-		if equality.Semantic.DeepEqual(oldInfo.Obj.Spec, w.Spec) {
-			cq.inadmissibleWorkloads[key] = workload.NewInfo(w)
+		if equality.Semantic.DeepEqual(oldInfo.Obj.Spec, wInfo.Obj.Spec) {
+			cq.inadmissibleWorkloads[key] = wInfo
 			return
 		}
 		// otherwise move or update in place in the queue.
 		delete(cq.inadmissibleWorkloads, key)
 	}
 
-	cq.ClusterQueueImpl.PushOrUpdate(w)
+	cq.ClusterQueueImpl.PushOrUpdate(wInfo)
 }
 
 func (cq *ClusterQueueBestEffortFIFO) Delete(w *kueue.Workload) {
diff --git a/pkg/queue/cluster_queue_impl.go b/pkg/queue/cluster_queue_impl.go
index 819dcc4e5..8d5e6b914 100644
--- a/pkg/queue/cluster_queue_impl.go
+++ b/pkg/queue/cluster_queue_impl.go
@@ -74,8 +74,7 @@ func (c *ClusterQueueImpl) pushIfNotPresent(info *workload.Info) bool {
 	return c.heap.PushIfNotPresent(info)
 }
 
-func (c *ClusterQueueImpl) PushOrUpdate(w *kueue.Workload) {
-	info := workload.NewInfo(w)
+func (c *ClusterQueueImpl) PushOrUpdate(info *workload.Info) {
 	c.heap.PushOrUpdate(info)
 }
 
diff --git a/pkg/queue/cluster_queue_interface.go b/pkg/queue/cluster_queue_interface.go
index 8d7f0309d..be302275a 100644
--- a/pkg/queue/cluster_queue_interface.go
+++ b/pkg/queue/cluster_queue_interface.go
@@ -43,7 +43,7 @@ type ClusterQueue interface {
 
 	// PushOrUpdate pushes the workload to ClusterQueue.
 	// If the workload is already present, updates with the new one.
-	PushOrUpdate(*kueue.Workload)
+	PushOrUpdate(*workload.Info)
 	// Delete removes the workload from ClusterQueue.
 	Delete(*kueue.Workload)
 	// Pop removes the head of the queue and returns it. It returns nil if the
diff --git a/pkg/queue/manager.go b/pkg/queue/manager.go
index 9d7fa7028..c233fe9b8 100644
--- a/pkg/queue/manager.go
+++ b/pkg/queue/manager.go
@@ -47,7 +47,6 @@ type Manager struct {
 	cond sync.Cond
 
 	client        client.Client
-	statusChecker StatusChecker
 	clusterQueues map[string]ClusterQueue
 	queues        map[string]*Queue
 
@@ -55,10 +54,9 @@ type Manager struct {
 	cohorts map[string]sets.String
 }
 
-func NewManager(client client.Client, checker StatusChecker) *Manager {
+func NewManager(client client.Client) *Manager {
 	m := &Manager{
 		client:        client,
-		statusChecker: checker,
 		queues:        make(map[string]*Queue),
 		clusterQueues: make(map[string]ClusterQueue),
 		cohorts:       make(map[string]sets.String),
@@ -171,7 +169,7 @@ func (m *Manager) AddQueue(ctx context.Context, q *kueue.Queue) error {
 		if w.Spec.QueueName != q.Name || w.Spec.Admission != nil {
 			continue
 		}
-		qImpl.AddOrUpdate(&w)
+		qImpl.AddOrUpdate(workload.NewInfo(&w))
 	}
 	cq := m.clusterQueues[qImpl.ClusterQueue]
 	if cq != nil && cq.AddFromQueue(qImpl) {
@@ -274,13 +272,14 @@ func (m *Manager) addOrUpdateWorkload(w *kueue.Workload) bool {
 	if q == nil {
 		return false
 	}
-	q.AddOrUpdate(w)
+	wInfo := workload.NewInfo(w)
+	q.AddOrUpdate(wInfo)
 	q.reportPendingWorkloads()
 	cq := m.clusterQueues[q.ClusterQueue]
 	if cq == nil {
 		return false
 	}
-	cq.PushOrUpdate(w)
+	cq.PushOrUpdate(wInfo)
 	m.Broadcast()
 	return true
 }
@@ -304,15 +303,14 @@ func (m *Manager) RequeueWorkload(ctx context.Context, info *workload.Info, imme
 	if q == nil {
 		return false
 	}
-	q.AddOrUpdate(&w)
+	info.Update(&w)
+	q.AddOrUpdate(info)
 	q.reportPendingWorkloads()
 	cq := m.clusterQueues[q.ClusterQueue]
 	if cq == nil {
 		return false
 	}
 
-	// TODO(#162) Update the info object instead of constructing one.
-	info = workload.NewInfo(&w)
 	added := cq.RequeueIfNotPresent(info, immediate)
 	if added {
 		m.Broadcast()
@@ -475,10 +473,6 @@ func (m *Manager) Dump() map[string]sets.String {
 func (m *Manager) heads() []workload.Info {
 	var workloads []workload.Info
 	for cqName, cq := range m.clusterQueues {
-		// Cache might be nil in tests, if cache is nil, we'll skip the check.
-		if m.statusChecker != nil && !m.statusChecker.ClusterQueueActive(cqName) {
-			continue
-		}
 		wl := cq.Pop()
 		if wl == nil {
 			continue
diff --git a/pkg/queue/queue.go b/pkg/queue/queue.go
index c9fe89641..de9acdd79 100644
--- a/pkg/queue/queue.go
+++ b/pkg/queue/queue.go
@@ -60,9 +60,9 @@ func (q *Queue) update(apiQueue *kueue.Queue) {
 	q.ClusterQueue = string(apiQueue.Spec.ClusterQueue)
 }
 
-func (q *Queue) AddOrUpdate(w *kueue.Workload) {
-	key := workload.Key(w)
-	q.items[key] = workload.NewInfo(w)
+func (q *Queue) AddOrUpdate(info *workload.Info) {
+	key := workload.Key(info.Obj)
+	q.items[key] = info
 }
 
 func (q *Queue) AddIfNotPresent(w *workload.Info) bool {
diff --git a/pkg/queue/status_checker.go b/pkg/queue/status_checker.go
deleted file mode 100644
index 737f425b3..000000000
--- a/pkg/queue/status_checker.go
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
-Copyright 2022 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package queue
-
-// StatusChecker checks status of clusterQueue.
-type StatusChecker interface {
-	// ClusterQueueActive returns whether the clusterQueue is active.
-	ClusterQueueActive(name string) bool
-}
diff --git a/pkg/util/priority/priority.go b/pkg/util/priority/priority.go
index d0c9c9995..c82b642c0 100644
--- a/pkg/util/priority/priority.go
+++ b/pkg/util/priority/priority.go
@@ -77,14 +77,11 @@ func getDefaultPriorityClass(ctx context.Context, client client.Client) (*schedu
 	// we pick the one with the lowest priority value.
 	var defaultPC *schedulingv1.PriorityClass
 	for _, pci := range pcs.Items {
-		item := pci
-
-		if item.GlobalDefault {
-			if defaultPC == nil || defaultPC.Value > item.Value {
-				defaultPC = &item
+		if pci.GlobalDefault {
+			if defaultPC == nil || defaultPC.Value > pci.Value {
+				defaultPC = &pci
 			}
 		}
 	}
-
 	return defaultPC, nil
 }
diff --git a/pkg/workload/workload.go b/pkg/workload/workload.go
index 0f49acd0c..b5d97b666 100644
--- a/pkg/workload/workload.go
+++ b/pkg/workload/workload.go
@@ -51,6 +51,10 @@ func NewInfo(w *kueue.Workload) *Info {
 	}
 }
 
+func (i *Info) Update(wl *kueue.Workload) {
+	i.Obj = wl
+}
+
 func Key(w *kueue.Workload) string {
 	return fmt.Sprintf("%s/%s", w.Namespace, w.Name)
 }


Test patch:
diff --git a/pkg/queue/cluster_queue_best_effort_fifo_test.go b/pkg/queue/cluster_queue_best_effort_fifo_test.go
index 8e5b45cec..29fa6dbf9 100644
--- a/pkg/queue/cluster_queue_best_effort_fifo_test.go
+++ b/pkg/queue/cluster_queue_best_effort_fifo_test.go
@@ -103,7 +103,7 @@ func TestClusterQueueBestEffortFIFO(t *testing.T) {
 			}
 
 			for _, w := range test.workloadsToAdd {
-				cq.PushOrUpdate(w)
+				cq.PushOrUpdate(workload.NewInfo(w))
 			}
 
 			for _, w := range test.inadmissibleWorkloadsToRequeue {
@@ -114,7 +114,7 @@ func TestClusterQueueBestEffortFIFO(t *testing.T) {
 			}
 
 			for _, w := range test.workloadsToUpdate {
-				cq.PushOrUpdate(w)
+				cq.PushOrUpdate(workload.NewInfo(w))
 			}
 
 			for _, w := range test.workloadsToDelete {
@@ -152,13 +152,15 @@ func TestDeleteFromQueue(t *testing.T) {
 	inadmissibleWorkloads := []*kueue.Workload{wl3, wl4}
 
 	for _, w := range admissibleworkloads {
-		cqImpl.PushOrUpdate(w)
-		qImpl.AddOrUpdate(w)
+		wInfo := workload.NewInfo(w)
+		cqImpl.PushOrUpdate(wInfo)
+		qImpl.AddOrUpdate(wInfo)
 	}
 
 	for _, w := range inadmissibleWorkloads {
-		cqImpl.RequeueIfNotPresent(workload.NewInfo(w), false)
-		qImpl.AddOrUpdate(w)
+		wInfo := workload.NewInfo(w)
+		cqImpl.RequeueIfNotPresent(wInfo, false)
+		qImpl.AddOrUpdate(wInfo)
 	}
 
 	wantPending := len(admissibleworkloads) + len(inadmissibleWorkloads)
diff --git a/pkg/queue/cluster_queue_impl_test.go b/pkg/queue/cluster_queue_impl_test.go
index 30657c0e0..521f30c6f 100644
--- a/pkg/queue/cluster_queue_impl_test.go
+++ b/pkg/queue/cluster_queue_impl_test.go
@@ -35,14 +35,14 @@ func Test_PushOrUpdate(t *testing.T) {
 	if cq.Pending() != 0 {
 		t.Error("ClusterQueue should be empty")
 	}
-	cq.PushOrUpdate(wl)
+	cq.PushOrUpdate(workload.NewInfo(wl))
 	if cq.Pending() != 1 {
 		t.Error("ClusterQueue should have one workload")
 	}
 
 	// Just used to validate the update operation.
 	wl.ResourceVersion = "1"
-	cq.PushOrUpdate(wl)
+	cq.PushOrUpdate(workload.NewInfo(wl))
 	newWl := cq.Pop()
 	if cq.Pending() != 0 || newWl.Obj.ResourceVersion != "1" {
 		t.Error("failed to update a workload in ClusterQueue")
@@ -52,8 +52,8 @@ func Test_PushOrUpdate(t *testing.T) {
 func Test_Pop(t *testing.T) {
 	cq := newClusterQueueImpl(keyFunc, byCreationTime)
 	now := time.Now()
-	wl1 := utiltesting.MakeWorkload("workload-1", defaultNamespace).Creation(now).Obj()
-	wl2 := utiltesting.MakeWorkload("workload-2", defaultNamespace).Creation(now.Add(time.Second)).Obj()
+	wl1 := workload.NewInfo(utiltesting.MakeWorkload("workload-1", defaultNamespace).Creation(now).Obj())
+	wl2 := workload.NewInfo(utiltesting.MakeWorkload("workload-2", defaultNamespace).Creation(now.Add(time.Second)).Obj())
 	if cq.Pop() != nil {
 		t.Error("ClusterQueue should be empty")
 	}
@@ -76,8 +76,8 @@ func Test_Delete(t *testing.T) {
 	cq := newClusterQueueImpl(keyFunc, byCreationTime)
 	wl1 := utiltesting.MakeWorkload("workload-1", defaultNamespace).Obj()
 	wl2 := utiltesting.MakeWorkload("workload-2", defaultNamespace).Obj()
-	cq.PushOrUpdate(wl1)
-	cq.PushOrUpdate(wl2)
+	cq.PushOrUpdate(workload.NewInfo(wl1))
+	cq.PushOrUpdate(workload.NewInfo(wl2))
 	if cq.Pending() != 2 {
 		t.Error("ClusterQueue should have two workload")
 	}
@@ -95,8 +95,8 @@ func Test_Delete(t *testing.T) {
 
 func Test_Dump(t *testing.T) {
 	cq := newClusterQueueImpl(keyFunc, byCreationTime)
-	wl1 := utiltesting.MakeWorkload("workload-1", defaultNamespace).Obj()
-	wl2 := utiltesting.MakeWorkload("workload-2", defaultNamespace).Obj()
+	wl1 := workload.NewInfo(utiltesting.MakeWorkload("workload-1", defaultNamespace).Obj())
+	wl2 := workload.NewInfo(utiltesting.MakeWorkload("workload-2", defaultNamespace).Obj())
 	if _, ok := cq.Dump(); ok {
 		t.Error("ClusterQueue should be empty")
 	}
@@ -113,7 +113,7 @@ func Test_Info(t *testing.T) {
 	if info := cq.Info(keyFunc(workload.NewInfo(wl))); info != nil {
 		t.Error("workload doesn't exist")
 	}
-	cq.PushOrUpdate(wl)
+	cq.PushOrUpdate(workload.NewInfo(wl))
 	if info := cq.Info(keyFunc(workload.NewInfo(wl))); info == nil {
 		t.Error("expected workload to exist")
 	}
@@ -127,7 +127,7 @@ func Test_AddFromQueue(t *testing.T) {
 			wl.Name: workload.NewInfo(wl),
 		},
 	}
-	cq.PushOrUpdate(wl)
+	cq.PushOrUpdate(workload.NewInfo(wl))
 	if added := cq.AddFromQueue(queue); added {
 		t.Error("expected workload not to be added")
 	}
diff --git a/pkg/queue/cluster_queue_strict_fifo_test.go b/pkg/queue/cluster_queue_strict_fifo_test.go
index 55eb3d003..a197b9028 100644
--- a/pkg/queue/cluster_queue_strict_fifo_test.go
+++ b/pkg/queue/cluster_queue_strict_fifo_test.go
@@ -24,6 +24,7 @@ import (
 	"k8s.io/utils/pointer"
 
 	kueue "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+	"sigs.k8s.io/kueue/pkg/workload"
 )
 
 const (
@@ -62,7 +63,7 @@ func TestFIFOClusterQueue(t *testing.T) {
 		},
 	}
 	for _, w := range ws {
-		q.PushOrUpdate(w)
+		q.PushOrUpdate(workload.NewInfo(w))
 	}
 	got := q.Pop()
 	if got == nil {
@@ -71,12 +72,13 @@ func TestFIFOClusterQueue(t *testing.T) {
 	if got.Obj.Name != "before" {
 		t.Errorf("Popped workload %q want %q", got.Obj.Name, "before")
 	}
-	q.PushOrUpdate(&kueue.Workload{
+	wlInfo := workload.NewInfo(&kueue.Workload{
 		ObjectMeta: metav1.ObjectMeta{
 			Name:              "after",
 			CreationTimestamp: metav1.NewTime(now.Add(-time.Minute)),
 		},
 	})
+	q.PushOrUpdate(wlInfo)
 	got = q.Pop()
 	if got == nil {
 		t.Fatal("Queue is empty")
@@ -178,8 +180,8 @@ func TestStrictFIFO(t *testing.T) {
 				t.Fatalf("Failed creating ClusterQueue %v", err)
 			}
 
-			q.PushOrUpdate(tt.w1)
-			q.PushOrUpdate(tt.w2)
+			q.PushOrUpdate(workload.NewInfo(tt.w1))
+			q.PushOrUpdate(workload.NewInfo(tt.w2))
 
 			got := q.Pop()
 			if got == nil {
diff --git a/pkg/queue/manager_test.go b/pkg/queue/manager_test.go
index 2379c8f96..acb4c4bfb 100644
--- a/pkg/queue/manager_test.go
+++ b/pkg/queue/manager_test.go
@@ -18,7 +18,7 @@ package queue
 
 import (
 	"context"
-	"strings"
+	"sort"
 	"testing"
 	"time"
 
@@ -52,7 +52,7 @@ func TestAddQueueOrphans(t *testing.T) {
 			Admit(utiltesting.MakeAdmission("cq").Obj()).Obj(),
 		utiltesting.MakeWorkload("a", "moon").Queue("foo").Obj(),
 	).Build()
-	manager := NewManager(kClient, nil)
+	manager := NewManager(kClient)
 	q := utiltesting.MakeQueue("foo", "earth").Obj()
 	if err := manager.AddQueue(context.Background(), q); err != nil {
 		t.Fatalf("Failed adding queue: %v", err)
@@ -86,7 +86,7 @@ func TestAddClusterQueueOrphans(t *testing.T) {
 		queues[1],
 	).Build()
 	ctx := context.Background()
-	manager := NewManager(kClient, nil)
+	manager := NewManager(kClient)
 	for _, q := range queues {
 		if err := manager.AddQueue(ctx, q); err != nil {
 			t.Fatalf("Failed adding queue %s: %v", q.Name, err)
@@ -125,7 +125,7 @@ func TestUpdateQueue(t *testing.T) {
 		t.Fatalf("Failed adding kueue scheme: %s", err)
 	}
 	ctx := context.Background()
-	manager := NewManager(fake.NewClientBuilder().WithScheme(scheme).Build(), nil)
+	manager := NewManager(fake.NewClientBuilder().WithScheme(scheme).Build())
 	for _, cq := range clusterQueues {
 		if err := manager.AddClusterQueue(ctx, cq); err != nil {
 			t.Fatalf("Failed adding clusterQueue %s: %v", cq.Name, err)
@@ -165,7 +165,7 @@ func TestAddWorkload(t *testing.T) {
 	if err := kueue.AddToScheme(scheme); err != nil {
 		t.Fatalf("Failed adding kueue scheme: %s", err)
 	}
-	manager := NewManager(fake.NewClientBuilder().WithScheme(scheme).Build(), nil)
+	manager := NewManager(fake.NewClientBuilder().WithScheme(scheme).Build())
 	cq := utiltesting.MakeClusterQueue("cq").Obj()
 	if err := manager.AddClusterQueue(context.Background(), cq); err != nil {
 		t.Fatalf("Failed adding clusterQueue %s: %v", cq.Name, err)
@@ -283,7 +283,7 @@ func TestStatus(t *testing.T) {
 		},
 	}
 
-	manager := NewManager(fake.NewClientBuilder().WithScheme(scheme).Build(), nil)
+	manager := NewManager(fake.NewClientBuilder().WithScheme(scheme).Build())
 	for _, q := range queues {
 		if err := manager.AddQueue(ctx, &q); err != nil {
 			t.Errorf("Failed adding queue: %s", err)
@@ -395,7 +395,7 @@ func TestRequeueWorkloadStrictFIFO(t *testing.T) {
 	for _, tc := range cases {
 		t.Run(tc.workload.Name, func(t *testing.T) {
 			cl := fake.NewClientBuilder().WithScheme(scheme).Build()
-			manager := NewManager(cl, nil)
+			manager := NewManager(cl)
 			ctx := context.Background()
 			if err := manager.AddClusterQueue(ctx, cq); err != nil {
 				t.Fatalf("Failed adding cluster queue %s: %v", cq.Name, err)
@@ -552,7 +552,7 @@ func TestUpdateWorkload(t *testing.T) {
 	}
 	for name, tc := range cases {
 		t.Run(name, func(t *testing.T) {
-			manager := NewManager(fake.NewClientBuilder().WithScheme(scheme).Build(), nil)
+			manager := NewManager(fake.NewClientBuilder().WithScheme(scheme).Build())
 			ctx := context.Background()
 			for _, cq := range tc.clusterQueues {
 				if err := manager.AddClusterQueue(ctx, cq); err != nil {
@@ -610,90 +610,94 @@ func TestUpdateWorkload(t *testing.T) {
 }
 
 func TestHeads(t *testing.T) {
+	ctx, cancel := context.WithTimeout(context.Background(), headsTimeout)
+	defer cancel()
 	scheme := runtime.NewScheme()
 	if err := kueue.AddToScheme(scheme); err != nil {
 		t.Fatalf("Failed adding kueue scheme: %s", err)
 	}
 	now := time.Now().Truncate(time.Second)
 
-	clusterQueues := []*kueue.ClusterQueue{
-		utiltesting.MakeClusterQueue("active-fooCq").Obj(),
-		utiltesting.MakeClusterQueue("active-barCq").Obj(),
-		utiltesting.MakeClusterQueue("pending-bazCq").Obj(),
+	clusterQueues := []kueue.ClusterQueue{
+		*utiltesting.MakeClusterQueue("fooCq").Obj(),
+		*utiltesting.MakeClusterQueue("barCq").Obj(),
 	}
-	queues := []*kueue.Queue{
-		utiltesting.MakeQueue("foo", "").ClusterQueue("active-fooCq").Obj(),
-		utiltesting.MakeQueue("bar", "").ClusterQueue("active-barCq").Obj(),
-		utiltesting.MakeQueue("baz", "").ClusterQueue("pending-bazCq").Obj(),
-	}
-	tests := []struct {
-		name          string
-		workloads     []*kueue.Workload
-		wantWorkloads sets.String
-	}{
+	queues := []kueue.Queue{
 		{
-			name:          "empty clusterQueues",
-			workloads:     []*kueue.Workload{},
-			wantWorkloads: sets.String{},
+			ObjectMeta: metav1.ObjectMeta{Name: "foo"},
+			Spec: kueue.QueueSpec{
+				ClusterQueue: "fooCq",
+			},
 		},
 		{
-			name: "active clusterQueues",
-			workloads: []*kueue.Workload{
-				utiltesting.MakeWorkload("a", "").Creation(now).Queue("foo").Obj(),
-				utiltesting.MakeWorkload("b", "").Creation(now).Queue("bar").Obj(),
+			ObjectMeta: metav1.ObjectMeta{Name: "bar"},
+			Spec: kueue.QueueSpec{
+				ClusterQueue: "barCq",
 			},
-			wantWorkloads: sets.NewString("a", "b"),
 		},
 		{
-			name: "active clusterQueues with multiple workloads",
-			workloads: []*kueue.Workload{
-				utiltesting.MakeWorkload("a1", "").Creation(now).Queue("foo").Obj(),
-				utiltesting.MakeWorkload("a2", "").Creation(now.Add(time.Hour)).Queue("foo").Obj(),
-				utiltesting.MakeWorkload("b", "").Creation(now).Queue("bar").Obj(),
+			ObjectMeta: metav1.ObjectMeta{Name: "baz"},
+			Spec: kueue.QueueSpec{
+				ClusterQueue: "bazCq",
 			},
-			wantWorkloads: sets.NewString("a1", "b"),
 		},
+	}
+	workloads := []kueue.Workload{
 		{
-			name: "inactive clusterQueues",
-			workloads: []*kueue.Workload{
-				utiltesting.MakeWorkload("a", "").Creation(now).Queue("foo").Obj(),
-				utiltesting.MakeWorkload("b", "").Creation(now).Queue("bar").Obj(),
-				utiltesting.MakeWorkload("c", "").Creation(now.Add(time.Hour)).Queue("baz").Obj(),
+			ObjectMeta: metav1.ObjectMeta{
+				Name:              "a",
+				CreationTimestamp: metav1.NewTime(now.Add(time.Hour)),
+			},
+			Spec: kueue.WorkloadSpec{QueueName: "foo"},
+		},
+		{
+			ObjectMeta: metav1.ObjectMeta{
+				Name:              "b",
+				CreationTimestamp: metav1.NewTime(now),
+			},
+			Spec: kueue.WorkloadSpec{QueueName: "bar"},
+		},
+		{
+			ObjectMeta: metav1.ObjectMeta{
+				Name:              "c",
+				CreationTimestamp: metav1.NewTime(now),
 			},
-			wantWorkloads: sets.NewString("a", "b"),
+			Spec: kueue.WorkloadSpec{QueueName: "foo"},
+		},
+	}
+	manager := NewManager(fake.NewClientBuilder().WithScheme(scheme).Build())
+	for _, cq := range clusterQueues {
+		if err := manager.AddClusterQueue(ctx, &cq); err != nil {
+			t.Fatalf("Failed adding clusterQueue %s: %v", cq.Name, err)
+		}
+	}
+	for _, q := range queues {
+		if err := manager.AddQueue(ctx, &q); err != nil {
+			t.Fatalf("Failed adding queue %s: %s", q.Name, err)
+		}
+	}
+	go manager.CleanUpOnContext(ctx)
+	for _, wl := range workloads {
+		wl := wl
+		manager.AddOrUpdateWorkload(&wl)
+	}
+	wantHeads := []workload.Info{
+		{
+			Obj:          &workloads[1],
+			ClusterQueue: "barCq",
+		},
+		{
+			Obj:          &workloads[2],
+			ClusterQueue: "fooCq",
 		},
 	}
-	for _, tc := range tests {
-		t.Run(tc.name, func(t *testing.T) {
-			ctx, cancel := context.WithTimeout(context.Background(), headsTimeout)
-			defer cancel()
-			fakeC := &fakeStatusChecker{}
-			manager := NewManager(fake.NewClientBuilder().WithScheme(scheme).Build(), fakeC)
-			for _, cq := range clusterQueues {
-				if err := manager.AddClusterQueue(ctx, cq); err != nil {
-					t.Fatalf("Failed adding clusterQueue %s to manager: %v", cq.Name, err)
-				}
-			}
-			for _, q := range queues {
-				if err := manager.AddQueue(ctx, q); err != nil {
-					t.Fatalf("Failed adding queue %s: %s", q.Name, err)
-				}
-			}
-
-			go manager.CleanUpOnContext(ctx)
-			for _, wl := range tc.workloads {
-				manager.AddOrUpdateWorkload(wl)
-			}
 
-			wlNames := sets.NewString()
-			heads := manager.Heads(ctx)
-			for _, h := range heads {
-				wlNames.Insert(h.Obj.Name)
-			}
-			if diff := cmp.Diff(tc.wantWorkloads, wlNames); diff != "" {
-				t.Errorf("GetHeads returned wrong heads (-want,+got):\n%s", diff)
-			}
-		})
+	heads := manager.Heads(ctx)
+	sort.Slice(heads, func(i, j int) bool {
+		return heads[i].Obj.Name < heads[j].Obj.Name
+	})
+	if diff := cmp.Diff(wantHeads, heads); diff != "" {
+		t.Errorf("GetHeads returned wrong heads (-want,+got):\n%s", diff)
 	}
 }
 
@@ -905,7 +909,7 @@ func TestHeadsAsync(t *testing.T) {
 			ctx, cancel := context.WithTimeout(context.Background(), headsTimeout)
 			defer cancel()
 			client := fake.NewClientBuilder().WithScheme(scheme).WithObjects(tc.initialObjs...).Build()
-			manager := NewManager(client, nil)
+			manager := NewManager(client)
 			go manager.CleanUpOnContext(ctx)
 			tc.op(ctx, manager)
 			heads := manager.Heads(ctx)
@@ -918,7 +922,7 @@ func TestHeadsAsync(t *testing.T) {
 
 // TestHeadsCancelled ensures that the Heads call returns when the context is closed.
 func TestHeadsCancelled(t *testing.T) {
-	manager := NewManager(fake.NewClientBuilder().Build(), nil)
+	manager := NewManager(fake.NewClientBuilder().Build())
 	ctx, cancel := context.WithCancel(context.Background())
 	go func() {
 		cancel()
@@ -948,9 +952,3 @@ func workloadNamesFromQ(q *Queue) sets.String {
 	}
 	return names
 }
-
-type fakeStatusChecker struct{}
-
-func (c *fakeStatusChecker) ClusterQueueActive(name string) bool {
-	return strings.Contains(name, "active-")
-}
diff --git a/pkg/scheduler/scheduler_test.go b/pkg/scheduler/scheduler_test.go
index 6e194cc5b..886153cf5 100644
--- a/pkg/scheduler/scheduler_test.go
+++ b/pkg/scheduler/scheduler_test.go
@@ -797,8 +797,8 @@ func TestSchedule(t *testing.T) {
 			broadcaster := record.NewBroadcaster()
 			recorder := broadcaster.NewRecorder(scheme,
 				corev1.EventSource{Component: constants.ManagerName})
+			qManager := queue.NewManager(cl)
 			cqCache := cache.New(cl)
-			qManager := queue.NewManager(cl, cqCache)
 			// Workloads are loaded into queues or clusterQueues as we add them.
 			for _, q := range queues {
 				if err := qManager.AddQueue(ctx, &q); err != nil {
@@ -1615,8 +1615,8 @@ var ignoreConditionTimestamps = cmpopts.IgnoreFields(kueue.WorkloadCondition{},
 
 func TestRequeueAndUpdate(t *testing.T) {
 	cq := utiltesting.MakeClusterQueue("cq").Obj()
-	q1 := utiltesting.MakeQueue("q1", "ns1").ClusterQueue(cq.Name).Obj()
-	w1 := utiltesting.MakeWorkload("w1", "ns1").Queue(q1.Name).Obj()
+	q1 := utiltesting.MakeQueue("q1", "ns1").ClusterQueue("cq").Obj()
+	w1 := utiltesting.MakeWorkload("w1", "ns1").Queue("q1").Obj()
 
 	cases := []struct {
 		name          string
@@ -1691,8 +1691,8 @@ func TestRequeueAndUpdate(t *testing.T) {
 			cl := clientBuilder.Build()
 			broadcaster := record.NewBroadcaster()
 			recorder := broadcaster.NewRecorder(scheme, corev1.EventSource{Component: constants.ManagerName})
+			qManager := queue.NewManager(cl)
 			cqCache := cache.New(cl)
-			qManager := queue.NewManager(cl, cqCache)
 			scheduler := New(qManager, cqCache, cl, recorder)
 			if err := qManager.AddQueue(ctx, q1); err != nil {
 				t.Fatalf("Inserting queue %s/%s in manager: %v", q1.Namespace, q1.Name, err)
@@ -1700,12 +1700,6 @@ func TestRequeueAndUpdate(t *testing.T) {
 			if err := qManager.AddClusterQueue(ctx, cq); err != nil {
 				t.Fatalf("Inserting clusterQueue %s in manager: %v", cq.Name, err)
 			}
-			if err := cqCache.AddClusterQueue(ctx, cq); err != nil {
-				t.Fatalf("Inserting clusterQueue %s to cache: %v", cq.Name, err)
-			}
-			if !cqCache.ClusterQueueActive(cq.Name) {
-				t.Fatalf("Status of ClusterQueue %s should be active", cq.Name)
-			}
 
 			wInfos := qManager.Heads(ctx)
 			if len(wInfos) != 1 {
diff --git a/pkg/util/priority/priority_test.go b/pkg/util/priority/priority_test.go
deleted file mode 100644
index 970a37fa8..000000000
--- a/pkg/util/priority/priority_test.go
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
-Copyright 2022 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package priority
-
-import (
-	"context"
-	"testing"
-
-	"github.com/google/go-cmp/cmp"
-	schedulingv1 "k8s.io/api/scheduling/v1"
-	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-	"k8s.io/apimachinery/pkg/runtime"
-	"sigs.k8s.io/controller-runtime/pkg/client/fake"
-
-	kueue "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
-	"sigs.k8s.io/kueue/pkg/constants"
-	"sigs.k8s.io/kueue/pkg/util/pointer"
-	utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
-)
-
-func TestPriority(t *testing.T) {
-	tests := map[string]struct {
-		workload *kueue.Workload
-		want     int32
-	}{
-		"priority is specified": {
-			workload: utiltesting.MakeWorkload("name", "ns").Priority(pointer.Int32(100)).Obj(),
-			want:     100,
-		},
-		"priority is empty": {
-			workload: &kueue.Workload{
-				Spec: kueue.WorkloadSpec{},
-			},
-			want: constants.DefaultPriority,
-		},
-	}
-
-	for desc, tt := range tests {
-		t.Run(desc, func(t *testing.T) {
-			got := Priority(tt.workload)
-			if got != tt.want {
-				t.Errorf("Priority does not match: got: %d, expected: %d", got, tt.want)
-			}
-		})
-	}
-}
-
-func TestGetPriorityFromPriorityClass(t *testing.T) {
-	scheme := runtime.NewScheme()
-	if err := schedulingv1.AddToScheme(scheme); err != nil {
-		t.Fatalf("Failed adding scheduling scheme: %v", err)
-	}
-
-	tests := map[string]struct {
-		priorityClassList      *schedulingv1.PriorityClassList
-		priorityClassName      string
-		wantPriorityClassName  string
-		wantPriorityClassValue int32
-		wantErr                string
-	}{
-		"priorityClass is specified and it exists": {
-			priorityClassList: &schedulingv1.PriorityClassList{
-				Items: []schedulingv1.PriorityClass{
-					{
-						ObjectMeta: v1.ObjectMeta{Name: "test"},
-						Value:      50,
-					},
-				},
-			},
-			priorityClassName:      "test",
-			wantPriorityClassName:  "test",
-			wantPriorityClassValue: 50,
-		},
-		"priorityClass is specified and it does not exist": {
-			priorityClassList: &schedulingv1.PriorityClassList{
-				Items: []schedulingv1.PriorityClass{},
-			},
-			priorityClassName: "test",
-			wantErr:           `priorityclasses.scheduling.k8s.io "test" not found`,
-		},
-		"priorityClass is unspecified and one global default exists": {
-			priorityClassList: &schedulingv1.PriorityClassList{
-				Items: []schedulingv1.PriorityClass{
-					{
-						ObjectMeta:    v1.ObjectMeta{Name: "globalDefault"},
-						GlobalDefault: true,
-						Value:         40,
-					},
-				},
-			},
-			wantPriorityClassName:  "globalDefault",
-			wantPriorityClassValue: 40,
-		},
-		"priorityClass is unspecified and multiple global defaults exist": {
-			priorityClassList: &schedulingv1.PriorityClassList{
-				Items: []schedulingv1.PriorityClass{
-					{
-						ObjectMeta:    v1.ObjectMeta{Name: "globalDefault1"},
-						GlobalDefault: true,
-						Value:         90,
-					},
-					{
-						ObjectMeta:    v1.ObjectMeta{Name: "globalDefault2"},
-						GlobalDefault: true,
-						Value:         20,
-					},
-					{
-						ObjectMeta:    v1.ObjectMeta{Name: "globalDefault3"},
-						GlobalDefault: true,
-						Value:         50,
-					},
-				},
-			},
-			wantPriorityClassName:  "globalDefault2",
-			wantPriorityClassValue: 20,
-		},
-	}
-
-	for desc, tt := range tests {
-		tt := tt
-		t.Run(desc, func(t *testing.T) {
-			t.Parallel()
-
-			builder := fake.NewClientBuilder().WithScheme(scheme).WithLists(tt.priorityClassList)
-			client := builder.Build()
-
-			name, value, err := GetPriorityFromPriorityClass(context.Background(), client, tt.priorityClassName)
-			if tt.wantErr != "" {
-				if err == nil {
-					t.Fatalf("expected an error")
-				}
-
-				if diff := cmp.Diff(tt.wantErr, err.Error()); diff != "" {
-					t.Errorf("unexpected error (-want,+got):\n%s", diff)
-				}
-				return
-			}
-
-			if err != nil {
-				t.Fatalf("unexpected error: %v", err)
-			}
-
-			if name != tt.wantPriorityClassName {
-				t.Errorf("unexpected name: got: %s, expected: %s", name, tt.wantPriorityClassName)
-			}
-
-			if value != tt.wantPriorityClassValue {
-				t.Errorf("unexpected value: got: %d, expected: %d", value, tt.wantPriorityClassValue)
-			}
-		})
-	}
-}
diff --git a/test/integration/controller/core/suite_test.go b/test/integration/controller/core/suite_test.go
index 9a2dcbda5..01c662fc4 100644
--- a/test/integration/controller/core/suite_test.go
+++ b/test/integration/controller/core/suite_test.go
@@ -68,8 +68,8 @@ func managerSetup(mgr manager.Manager, ctx context.Context) {
 	err = cache.SetupIndexes(mgr.GetFieldIndexer())
 	gomega.Expect(err).NotTo(gomega.HaveOccurred())
 
+	queues := queue.NewManager(mgr.GetClient())
 	cCache := cache.New(mgr.GetClient())
-	queues := queue.NewManager(mgr.GetClient(), cCache)
 
 	failedCtrl, err := core.SetupControllers(mgr, queues, cCache)
 	gomega.Expect(err).ToNot(gomega.HaveOccurred(), "controller", failedCtrl)
diff --git a/test/integration/scheduler/suite_test.go b/test/integration/scheduler/suite_test.go
index 48bd64884..07f905947 100644
--- a/test/integration/scheduler/suite_test.go
+++ b/test/integration/scheduler/suite_test.go
@@ -71,8 +71,8 @@ func managerAndSchedulerSetup(mgr manager.Manager, ctx context.Context) {
 	err = cache.SetupIndexes(mgr.GetFieldIndexer())
 	gomega.Expect(err).NotTo(gomega.HaveOccurred())
 
+	queues := queue.NewManager(mgr.GetClient())
 	cCache := cache.New(mgr.GetClient())
-	queues := queue.NewManager(mgr.GetClient(), cCache)
 
 	failedCtrl, err := core.SetupControllers(mgr, queues, cCache)
 	gomega.Expect(err).ToNot(gomega.HaveOccurred(), "controller", failedCtrl)