Repository: kubernetes-sigs/kueue

Issue:
[integration tests flake]  fairsharing ./test/integration/singlecluster/scheduler/fairsharing
/kind flake

**What happened**:
failures on unreleated branches: https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/kubernetes-sigs_kueue/6944/pull-kueue-test-integration-baseline-main/1970474873939562496

https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/kubernetes-sigs_kueue/6942/pull-kueue-test-integration-baseline-main/1970475502288244736

**What you expected to happen**:
no failure
**How to reproduce it (as minimally and precisely as possible)**:

```

There were failures detected in the following suites:
  fairsharing ./test/integration/singlecluster/scheduler/fairsharing
Test Suite Failed
make: *** [Makefile-test.mk:72: test-integration] Error 1
```

Discussion:
@mimowo: cc @mbobrovskyi @gabesaba @amy @PBundyra in case you have some ideas why the integration tests started to flake. 

Maybe that is related to the latest fixes to FS? OTOH it does not like test failing, but somehow the test runner.@mimowo: ```
==================
WARNING: DATA RACE
Read at 0x00c0000e57c8 by goroutine 232:
  sigs.k8s.io/kueue/pkg/cache/scheduler.(*Cache).Snapshot()
      /home/prow/go/src/sigs.k8s.io/kueue/pkg/cache/scheduler/snapshot.go:141 +0x6dd
  sigs.k8s.io/kueue/pkg/scheduler.(*Scheduler).schedule()
      /home/prow/go/src/sigs.k8s.io/kueue/pkg/scheduler/scheduler.go:210 +0x596
  sigs.k8s.io/kueue/pkg/scheduler.(*Scheduler).schedule-fm()
      <autogenerated>:1 +0x47
  sigs.k8s.io/kueue/pkg/util/wait.untilWithBackoff.func1()
      /home/prow/go/src/sigs.k8s.io/kueue/pkg/util/wait/backoff.go:43 +0x58
  k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1()
      /home/prow/go/src/sigs.k8s.io/kueue/vendor/k8s.io/apimachinery/pkg/util/wait/backoff.go:233 +0x2e
  k8s.io/apimachinery/pkg/util/wait.BackoffUntilWithContext.func1()
      /home/prow/go/src/sigs.k8s.io/kueue/vendor/k8s.io/apimachinery/pkg/util/wait/backoff.go:255 +0x98
  k8s.io/apimachinery/pkg/util/wait.BackoffUntilWithContext()
      /home/prow/go/src/sigs.k8s.io/kueue/vendor/k8s.io/apimachinery/pkg/util/wait/backoff.go:256 +0xed
  k8s.io/apimachinery/pkg/util/wait.BackoffUntil()
      /home/prow/go/src/sigs.k8s.io/kueue/vendor/k8s.io/apimachinery/pkg/util/wait/backoff.go:233 +0x8a
  sigs.k8s.io/kueue/pkg/util/wait.untilWithBackoff()
      /home/prow/go/src/sigs.k8s.io/kueue/pkg/util/wait/backoff.go:42 +0x144
  sigs.k8s.io/kueue/pkg/util/wait.UntilWithBackoff()
      /home/prow/go/src/sigs.k8s.io/kueue/pkg/util/wait/backoff.go:34 +0xc9
  sigs.k8s.io/kueue/pkg/scheduler.(*Scheduler).Start.gowrap1()
      /home/prow/go/src/sigs.k8s.io/kueue/pkg/scheduler/scheduler.go:161 +0x4f
Previous write at 0x00c0000e57c8 by goroutine 493:

Previous write at 0x00c0000e57c8 by goroutine 493:
  k8s.io/apimachinery/pkg/api/resource.(*Quantity).AsDec()
      /home/prow/go/src/sigs.k8s.io/kueue/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go:538 +0xb0
  k8s.io/apimachinery/pkg/api/resource.(*Quantity).AsFloat64Slow()
      /home/prow/go/src/sigs.k8s.io/kueue/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go:489 +0x3e
  sigs.k8s.io/kueue/pkg/cache/scheduler.DRS.PreciseWeightedShare()
push_pin
      /home/prow/go/src/sigs.k8s.io/kueue/pkg/cache/scheduler/fair_sharing.go:71 +0x135
  sigs.k8s.io/kueue/pkg/cache/scheduler.DRS.roundedWeightedShare()
      /home/prow/go/src/sigs.k8s.io/kueue/pkg/cache/scheduler/fair_sharing.go:104 +0x104
  sigs.k8s.io/kueue/pkg/cache/scheduler.(*Cache).CohortStats()
      /home/prow/go/src/sigs.k8s.io/kueue/pkg/cache/scheduler/cache.go:733 +0x1e9
  sigs.k8s.io/kueue/pkg/controller/core.(*CohortReconciler).updateCohortStatusIfChanged()
      /home/prow/go/src/sigs.k8s.io/kueue/pkg/controller/core/cohort_controller.go:163 +0xf1
  sigs.k8s.io/kueue/pkg/controller/core.(*CohortReconciler).Reconcile()
      /home/prow/go/src/sigs.k8s.io/kueue/pkg/controller/core/cohort_controller.go:154 +0x4b5
  sigs.k8s.io/kueue/pkg/controller/core.(*leaderAwareReconciler).Reconcile()
      /home/prow/go/src/sigs.k8s.io/kueue/pkg/controller/core/leader_aware_reconciler.go:77 +0x23c
  sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[go.shape.struct { k8s.io/apimachinery/pkg/types.NamespacedName }]).Reconcile()
      /home/prow/go/src/sigs.k8s.io/kueue/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:119 +0x1b2
  sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[go.shape.struct { k8s.io/apimachinery/pkg/types.NamespacedName }]).reconcileHandler()
      /home/prow/go/src/sigs.k8s.io/kueue/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:340 +0x51d
  sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[go.shape.struct { k8s.io/apimachinery/pkg/types.NamespacedName }]).processNextWorkItem()
      /home/prow/go/src/sigs.k8s.io/kueue/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:300 +0x3ac
  sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[go.shape.struct { k8s.io/apimachinery/pkg/types.NamespacedName }]).Start.func2.1()
      /home/prow/go/src/sigs.k8s.io/kueue/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:202 +0xe4
```
found here: https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/kubernetes-sigs_kueue/6963/pull-kueue-test-integration-baseline-main/1970487618420346880#1:build-log.txt%3A62645

Solution patch:
diff --git a/pkg/cache/scheduler/clusterqueue.go b/pkg/cache/scheduler/clusterqueue.go
index 73f50193e..5d11139ce 100644
--- a/pkg/cache/scheduler/clusterqueue.go
+++ b/pkg/cache/scheduler/clusterqueue.go
@@ -26,7 +26,6 @@ import (
 	"github.com/go-logr/logr"
 	"k8s.io/apimachinery/pkg/api/equality"
 	apimeta "k8s.io/apimachinery/pkg/api/meta"
-	"k8s.io/apimachinery/pkg/api/resource"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/apimachinery/pkg/labels"
 	"k8s.io/apimachinery/pkg/util/sets"
@@ -57,7 +56,7 @@ type clusterQueue struct {
 	WorkloadsNotReady sets.Set[workload.Reference]
 	NamespaceSelector labels.Selector
 	Preemption        kueue.ClusterQueuePreemption
-	FairWeight        resource.Quantity
+	FairWeight        float64
 	FlavorFungibility kueue.FlavorFungibility
 	// Aggregates AdmissionChecks from both .spec.AdmissionChecks and .spec.AdmissionCheckStrategy
 	// Sets hold ResourceFlavors to which an AdmissionCheck should apply.
@@ -621,8 +620,8 @@ func workloadBelongsToLocalQueue(wl *kueue.Workload, q *kueue.LocalQueue) bool {
 
 // Implements dominantResourceShareNode interface.
 
-func (c *clusterQueue) fairWeight() *resource.Quantity {
-	return &c.FairWeight
+func (c *clusterQueue) fairWeight() float64 {
+	return c.FairWeight
 }
 
 func (c *clusterQueue) isTASOnly() bool {
diff --git a/pkg/cache/scheduler/clusterqueue_snapshot.go b/pkg/cache/scheduler/clusterqueue_snapshot.go
index a9595950b..9036df94a 100644
--- a/pkg/cache/scheduler/clusterqueue_snapshot.go
+++ b/pkg/cache/scheduler/clusterqueue_snapshot.go
@@ -21,7 +21,6 @@ import (
 	"maps"
 
 	corev1 "k8s.io/api/core/v1"
-	"k8s.io/apimachinery/pkg/api/resource"
 	"k8s.io/apimachinery/pkg/labels"
 	"k8s.io/apimachinery/pkg/util/sets"
 
@@ -41,7 +40,7 @@ type ClusterQueueSnapshot struct {
 	WorkloadsNotReady sets.Set[workload.Reference]
 	NamespaceSelector labels.Selector
 	Preemption        kueue.ClusterQueuePreemption
-	FairWeight        resource.Quantity
+	FairWeight        float64
 	FlavorFungibility kueue.FlavorFungibility
 	AdmissionScope    kueue.AdmissionScope
 	// Aggregates AdmissionChecks from both .spec.AdmissionChecks and .spec.AdmissionCheckStrategy
@@ -186,8 +185,8 @@ func (c *ClusterQueueSnapshot) GetName() kueue.ClusterQueueReference {
 
 // Implements dominantResourceShareNode interface.
 
-func (c *ClusterQueueSnapshot) fairWeight() *resource.Quantity {
-	return &c.FairWeight
+func (c *ClusterQueueSnapshot) fairWeight() float64 {
+	return c.FairWeight
 }
 
 // implement flatResourceNode/hierarchicalResourceNode interfaces
diff --git a/pkg/cache/scheduler/cohort.go b/pkg/cache/scheduler/cohort.go
index 255fda677..fc89fe5fd 100644
--- a/pkg/cache/scheduler/cohort.go
+++ b/pkg/cache/scheduler/cohort.go
@@ -19,8 +19,6 @@ package scheduler
 import (
 	"iter"
 
-	"k8s.io/apimachinery/pkg/api/resource"
-
 	kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
 	"sigs.k8s.io/kueue/pkg/cache/hierarchy"
 )
@@ -32,7 +30,7 @@ type cohort struct {
 
 	resourceNode resourceNode
 
-	FairWeight resource.Quantity
+	FairWeight float64
 }
 
 func newCohort(name kueue.CohortReference) *cohort {
@@ -82,8 +80,8 @@ func (c *cohort) CCParent() hierarchy.CycleCheckable {
 
 // Implements dominantResourceShareNode interface.
 
-func (c *cohort) fairWeight() *resource.Quantity {
-	return &c.FairWeight
+func (c *cohort) fairWeight() float64 {
+	return c.FairWeight
 }
 
 // Returns all ancestors starting with self and ending with root
diff --git a/pkg/cache/scheduler/cohort_snapshot.go b/pkg/cache/scheduler/cohort_snapshot.go
index 86897359e..556ad5ff1 100644
--- a/pkg/cache/scheduler/cohort_snapshot.go
+++ b/pkg/cache/scheduler/cohort_snapshot.go
@@ -17,8 +17,6 @@ limitations under the License.
 package scheduler
 
 import (
-	"k8s.io/apimachinery/pkg/api/resource"
-
 	kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
 	"sigs.k8s.io/kueue/pkg/cache/hierarchy"
 	"sigs.k8s.io/kueue/pkg/resources"
@@ -30,7 +28,7 @@ type CohortSnapshot struct {
 	ResourceNode resourceNode
 	hierarchy.Cohort[*ClusterQueueSnapshot, *CohortSnapshot]
 
-	FairWeight resource.Quantity
+	FairWeight float64
 }
 
 func (c *CohortSnapshot) GetName() kueue.CohortReference {
@@ -85,8 +83,8 @@ func (c *CohortSnapshot) parentHRN() hierarchicalResourceNode {
 
 // Implements dominantResourceShareNode interface.
 
-func (c *CohortSnapshot) fairWeight() *resource.Quantity {
-	return &c.FairWeight
+func (c *CohortSnapshot) fairWeight() float64 {
+	return c.FairWeight
 }
 
 func (c *CohortSnapshot) BorrowingWith(fr resources.FlavorResource, val int64) bool {
diff --git a/pkg/cache/scheduler/fair_sharing.go b/pkg/cache/scheduler/fair_sharing.go
index 53fac811f..3db3df730 100644
--- a/pkg/cache/scheduler/fair_sharing.go
+++ b/pkg/cache/scheduler/fair_sharing.go
@@ -21,35 +21,34 @@ import (
 	"math"
 
 	corev1 "k8s.io/api/core/v1"
-	"k8s.io/apimachinery/pkg/api/resource"
 
 	kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
 	"sigs.k8s.io/kueue/pkg/resources"
 )
 
-var (
-	oneQuantity = resource.MustParse("1")
+const (
+	defaultWeight = 1.0
 )
 
 // dominantResourceShareNode is a node in the Cohort tree on which we
 // can compute its dominantResourceShare.
 type dominantResourceShareNode interface {
 	// see FairSharing.Weight in the API.
-	fairWeight() *resource.Quantity
+	fairWeight() float64
 	hierarchicalResourceNode
 }
 
 // DRS contains the DominantResourceShare for some
 // node, with convenence methods for precise comparison.
 type DRS struct {
-	fairWeight       *resource.Quantity
+	fairWeight       float64
 	unweightedRatio  float64
 	dominantResource corev1.ResourceName
 }
 
 // NegativeDRS is used as a starting point for comparisons.
 func NegativeDRS() DRS {
-	return DRS{unweightedRatio: -1, dominantResource: "", fairWeight: &oneQuantity}
+	return DRS{unweightedRatio: -1, dominantResource: "", fairWeight: defaultWeight}
 }
 
 // IsZero returns whether the DRS is 0. In other words,
@@ -59,21 +58,20 @@ func (d DRS) IsZero() bool {
 	return d.unweightedRatio == 0
 }
 
+func (d DRS) isWeightZero() bool {
+	return d.fairWeight == 0
+}
+
 func (d DRS) PreciseWeightedShare() float64 {
 	if d.IsZero() {
 		return 0.0
 	}
-	if d.fairWeight.IsZero() {
+	if d.isWeightZero() {
 		// This branch is used only for logging; functional
 		// branches never reach here.
 		return math.Inf(1)
 	}
-	// We make a copy to ensure the fairWeight object doesn’t change after calling AsFloat64Slow().
-	// This can happen because quantity.AsDec mutates the underlying state
-	// (see https://github.com/kubernetes/apimachinery/blob/da5b06e2fb6698d6db8866899150ec2c1b4518d9/pkg/api/resource/quantity.go#L538).
-	// This mutation triggers the golang data race reporting when the DRS structure is used from multiple goroutines.
-	frWeightCopy := d.fairWeight.DeepCopy()
-	return d.unweightedRatio / frWeightCopy.AsFloat64Slow()
+	return d.unweightedRatio / d.fairWeight
 }
 
 // CompareDRS compares two DRS values. A lower value
@@ -114,7 +112,7 @@ func (d DRS) roundedWeightedShare() (int64, corev1.ResourceName) {
 // zeroWeightBorrows returns whether this DRS represents a
 // borrowing state for a ClusterQueue/Cohort with a zero weight.
 func (d DRS) zeroWeightBorrows() bool {
-	return d.fairWeight.IsZero() && !d.IsZero()
+	return d.isWeightZero() && !d.IsZero()
 }
 
 func dominantResourceShare(node dominantResourceShareNode, wlReq resources.FlavorResourceQuantities) DRS {
@@ -168,9 +166,16 @@ func calculateLendable(node hierarchicalResourceNode) map[corev1.ResourceName]in
 
 // parseFairWeight parses FairSharing.Weight if it exists,
 // or otherwise returns the default value of 1.
-func parseFairWeight(fs *kueue.FairSharing) resource.Quantity {
+func parseFairWeight(fs *kueue.FairSharing) float64 {
 	if fs == nil || fs.Weight == nil {
-		return oneQuantity
+		return defaultWeight
 	}
-	return *fs.Weight
+
+	// We make a deep copy to avoid any data race, as this is a
+	// mutating method. Even though parseFairWeight is only called
+	// when we're holding the cache's write lock, we race with the
+	// informer cache. See
+	// https://github.com/kubernetes/apimachinery/blob/da5b06e2fb6698d6db8866899150ec2c1b4518d9/pkg/api/resource/quantity.go#L538-L539
+	weightDeepCopy := fs.Weight.DeepCopy()
+	return weightDeepCopy.AsFloat64Slow()
 }



Test patch:
diff --git a/pkg/cache/scheduler/cache_test.go b/pkg/cache/scheduler/cache_test.go
index cb748d2a8..50dd92f2a 100644
--- a/pkg/cache/scheduler/cache_test.go
+++ b/pkg/cache/scheduler/cache_test.go
@@ -118,7 +118,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"b": {
 					Name:                          "b",
@@ -127,7 +127,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"c": {
 					Name:                          "c",
@@ -136,7 +136,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"d": {
 					Name:                          "d",
@@ -145,7 +145,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"e": {
 					Name:                          "e",
@@ -154,7 +154,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        pending,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"f": {
 					Name:                          "f",
@@ -166,7 +166,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 						WhenCanBorrow:  kueue.TryNextFlavor,
 						WhenCanPreempt: kueue.TryNextFlavor,
 					},
-					FairWeight: oneQuantity,
+					FairWeight: defaultWeight,
 				},
 			},
 			wantCohorts: map[kueue.CohortReference]sets.Set[kueue.ClusterQueueReference]{
@@ -197,7 +197,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 						ReclaimWithinCohort: kueue.PreemptionPolicyLowerPriority,
 						WithinClusterQueue:  kueue.PreemptionPolicyLowerPriority,
 					},
-					FairWeight: oneQuantity,
+					FairWeight: defaultWeight,
 				},
 			},
 		},
@@ -218,7 +218,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					Status:                        active,
 					FlavorFungibility:             defaultFlavorFungibility,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    resource.MustParse("2"),
+					FairWeight:                    2.0,
 				},
 			},
 		},
@@ -244,7 +244,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					NamespaceSelector:             labels.Nothing(),
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"b": {
 					Name:                          "b",
@@ -253,7 +253,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					NamespaceSelector:             labels.Nothing(),
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"c": {
 					Name:                          "c",
@@ -262,7 +262,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"d": {
 					Name:                          "d",
@@ -271,7 +271,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"e": {
 					Name:                          "e",
@@ -280,7 +280,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        pending,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"f": {
 					Name:                          "f",
@@ -292,7 +292,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 						WhenCanBorrow:  kueue.TryNextFlavor,
 						WhenCanPreempt: kueue.TryNextFlavor,
 					},
-					FairWeight: oneQuantity,
+					FairWeight: defaultWeight,
 				},
 			},
 			wantCohorts: map[kueue.CohortReference]sets.Set[kueue.ClusterQueueReference]{
@@ -345,7 +345,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"b": {
 					Name:                          "b",
@@ -354,7 +354,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"c": {
 					Name:                          "c",
@@ -363,7 +363,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"d": {
 					Name:                          "d",
@@ -372,7 +372,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"e": {
 					Name:                          "e",
@@ -381,7 +381,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"f": {
 					Name:                          "f",
@@ -393,7 +393,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 						WhenCanBorrow:  kueue.TryNextFlavor,
 						WhenCanPreempt: kueue.TryNextFlavor,
 					},
-					FairWeight: oneQuantity,
+					FairWeight: defaultWeight,
 				},
 			},
 			wantCohorts: map[kueue.CohortReference]sets.Set[kueue.ClusterQueueReference]{
@@ -460,7 +460,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					},
 					Status:     active,
 					Preemption: defaultPreemption,
-					FairWeight: oneQuantity,
+					FairWeight: defaultWeight,
 					Workloads: map[workload.Reference]*workload.Info{
 						"/one": {
 							Obj: utiltesting.MakeWorkload("one", "").
@@ -520,7 +520,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 					NamespaceSelector:             labels.Nothing(),
 				},
 				"b": {
@@ -529,7 +529,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 					NamespaceSelector:             labels.Nothing(),
 				},
 				"c": {
@@ -538,7 +538,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 					NamespaceSelector:             labels.Nothing(),
 				},
 			},
@@ -573,7 +573,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"c": {
 					Name:                          "c",
@@ -582,7 +582,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"e": {
 					Name:                          "e",
@@ -591,7 +591,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        pending,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"f": {
 					Name:                          "f",
@@ -603,7 +603,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 						WhenCanBorrow:  kueue.TryNextFlavor,
 						WhenCanPreempt: kueue.TryNextFlavor,
 					},
-					FairWeight: oneQuantity,
+					FairWeight: defaultWeight,
 				},
 			},
 			wantCohorts: map[kueue.CohortReference]sets.Set[kueue.ClusterQueueReference]{
@@ -629,7 +629,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"b": {
 					Name:                          "b",
@@ -638,7 +638,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"c": {
 					Name:                          "c",
@@ -647,7 +647,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"d": {
 					Name:                          "d",
@@ -656,7 +656,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"e": {
 					Name:                          "e",
@@ -665,7 +665,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        active,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 				"f": {
 					Name:                          "f",
@@ -677,7 +677,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 						WhenCanBorrow:  kueue.TryNextFlavor,
 						WhenCanPreempt: kueue.TryNextFlavor,
 					},
-					FairWeight: oneQuantity,
+					FairWeight: defaultWeight,
 				},
 			},
 			wantCohorts: map[kueue.CohortReference]sets.Set[kueue.ClusterQueueReference]{
@@ -718,7 +718,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					FlavorFungibility:             defaultFlavorFungibility,
 					Status:                        pending,
 					Preemption:                    defaultPreemption,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 			},
 		},
@@ -746,7 +746,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 						"check1": sets.New[kueue.ResourceFlavorReference](),
 						"check2": sets.New[kueue.ResourceFlavorReference](),
 					},
-					FairWeight: oneQuantity,
+					FairWeight: defaultWeight,
 				},
 			},
 			wantCohorts: map[kueue.CohortReference]sets.Set[kueue.ClusterQueueReference]{},
@@ -778,7 +778,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 						"check1": sets.New[kueue.ResourceFlavorReference](),
 						"check2": sets.New[kueue.ResourceFlavorReference](),
 					},
-					FairWeight: oneQuantity,
+					FairWeight: defaultWeight,
 				},
 			},
 			wantCohorts: map[kueue.CohortReference]sets.Set[kueue.ClusterQueueReference]{},
@@ -811,7 +811,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 						"check1": sets.New[kueue.ResourceFlavorReference](),
 						"check2": sets.New[kueue.ResourceFlavorReference](),
 					},
-					FairWeight: oneQuantity,
+					FairWeight: defaultWeight,
 				},
 			},
 			wantCohorts: map[kueue.CohortReference]sets.Set[kueue.ClusterQueueReference]{},
@@ -844,7 +844,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 						"check1": sets.New[kueue.ResourceFlavorReference](),
 						"check2": sets.New[kueue.ResourceFlavorReference](),
 					},
-					FairWeight: oneQuantity,
+					FairWeight: defaultWeight,
 				},
 			},
 			wantCohorts: map[kueue.CohortReference]sets.Set[kueue.ClusterQueueReference]{},
@@ -906,7 +906,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					AdmittedUsage: resources.FlavorResourceQuantities{
 						{Flavor: "f1", Resource: corev1.ResourceCPU}: 1000,
 					},
-					FairWeight: oneQuantity,
+					FairWeight: defaultWeight,
 					resourceNode: resourceNode{
 						Usage: resources.FlavorResourceQuantities{
 							{Flavor: "f1", Resource: corev1.ResourceCPU}: 2000,
@@ -1003,7 +1003,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					Preemption:                    defaultPreemption,
 					AllocatableResourceGeneration: 1,
 					FlavorFungibility:             defaultFlavorFungibility,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 			},
 		},
@@ -1067,7 +1067,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					Preemption:                    defaultPreemption,
 					AllocatableResourceGeneration: 1,
 					FlavorFungibility:             defaultFlavorFungibility,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 			},
 		},
@@ -1110,7 +1110,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					Preemption:                    defaultPreemption,
 					AllocatableResourceGeneration: 2,
 					FlavorFungibility:             defaultFlavorFungibility,
-					FairWeight:                    oneQuantity,
+					FairWeight:                    defaultWeight,
 				},
 			},
 			wantCohorts: map[kueue.CohortReference]sets.Set[kueue.ClusterQueueReference]{
diff --git a/pkg/cache/scheduler/fair_sharing_test.go b/pkg/cache/scheduler/fair_sharing_test.go
index 3ef7454ee..09c0e43d3 100644
--- a/pkg/cache/scheduler/fair_sharing_test.go
+++ b/pkg/cache/scheduler/fair_sharing_test.go
@@ -82,7 +82,7 @@ func TestDominantResourceShare(t *testing.T) {
 			},
 			clusterQueue: utiltesting.MakeClusterQueue("cq").
 				Cohort("test-cohort").
-				FairWeight(oneQuantity).
+				FairWeight(resource.MustParse("1")).
 				ResourceGroup(
 					*utiltesting.MakeFlavorQuotas("default").
 						ResourceQuotaWrapper("cpu").NominalQuota("2").Append().
@@ -91,7 +91,7 @@ func TestDominantResourceShare(t *testing.T) {
 				).Obj(),
 			lendingClusterQueue: utiltesting.MakeClusterQueue("lending-cq").
 				Cohort("test-cohort").
-				FairWeight(oneQuantity).
+				FairWeight(resource.MustParse("1")).
 				ResourceGroup(
 					*utiltesting.MakeFlavorQuotas("default").
 						ResourceQuotaWrapper("cpu").NominalQuota("8").Append().
@@ -126,7 +126,7 @@ func TestDominantResourceShare(t *testing.T) {
 			},
 			clusterQueue: utiltesting.MakeClusterQueue("cq").
 				Cohort("test-cohort").
-				FairWeight(oneQuantity).
+				FairWeight(resource.MustParse("1")).
 				ResourceGroup(
 					*utiltesting.MakeFlavorQuotas("default").
 						ResourceQuotaWrapper("cpu").NominalQuota("2").Append().
@@ -135,7 +135,7 @@ func TestDominantResourceShare(t *testing.T) {
 				).Obj(),
 			lendingClusterQueue: utiltesting.MakeClusterQueue("lending-cq").
 				Cohort("test-cohort").
-				FairWeight(oneQuantity).
+				FairWeight(resource.MustParse("1")).
 				ResourceGroup(
 					*utiltesting.MakeFlavorQuotas("default").
 						ResourceQuotaWrapper("cpu").NominalQuota("8").Append().
@@ -169,7 +169,7 @@ func TestDominantResourceShare(t *testing.T) {
 			},
 			clusterQueue: utiltesting.MakeClusterQueue("cq").
 				Cohort("test-cohort").
-				FairWeight(oneQuantity).
+				FairWeight(resource.MustParse("1")).
 				ResourceGroup(
 					*utiltesting.MakeFlavorQuotas("default").
 						ResourceQuotaWrapper("example.com/gpu").NominalQuota("500").Append().
@@ -252,7 +252,7 @@ func TestDominantResourceShare(t *testing.T) {
 			},
 			clusterQueue: utiltesting.MakeClusterQueue("cq").
 				Cohort("test-cohort").
-				FairWeight(oneQuantity).
+				FairWeight(resource.MustParse("1")).
 				ResourceGroup(
 					*utiltesting.MakeFlavorQuotas("default").
 						ResourceQuotaWrapper("cpu").NominalQuota("2").Append().
@@ -261,7 +261,7 @@ func TestDominantResourceShare(t *testing.T) {
 				).Obj(),
 			lendingClusterQueue: utiltesting.MakeClusterQueue("lending-cq").
 				Cohort("test-cohort").
-				FairWeight(oneQuantity).
+				FairWeight(resource.MustParse("1")).
 				ResourceGroup(
 					*utiltesting.MakeFlavorQuotas("default").
 						ResourceQuotaWrapper("cpu").NominalQuota("8").Append().
@@ -296,7 +296,7 @@ func TestDominantResourceShare(t *testing.T) {
 			},
 			clusterQueue: utiltesting.MakeClusterQueue("cq").
 				Cohort("test-cohort").
-				FairWeight(oneQuantity).
+				FairWeight(resource.MustParse("1")).
 				ResourceGroup(
 					*utiltesting.MakeFlavorQuotas("default").
 						ResourceQuotaWrapper("cpu").NominalQuota("2").Append().
@@ -305,7 +305,7 @@ func TestDominantResourceShare(t *testing.T) {
 				).Obj(),
 			lendingClusterQueue: utiltesting.MakeClusterQueue("lending-cq").
 				Cohort("test-cohort").
-				FairWeight(oneQuantity).
+				FairWeight(resource.MustParse("1")).
 				ResourceGroup(
 					*utiltesting.MakeFlavorQuotas("default").
 						ResourceQuotaWrapper("cpu").NominalQuota("8").Append().
@@ -344,7 +344,7 @@ func TestDominantResourceShare(t *testing.T) {
 			},
 			clusterQueue: utiltesting.MakeClusterQueue("cq").
 				Cohort("test-cohort").
-				FairWeight(oneQuantity).
+				FairWeight(resource.MustParse("1")).
 				ResourceGroup(
 					*utiltesting.MakeFlavorQuotas("default").
 						ResourceQuotaWrapper("cpu").NominalQuota("2").Append().
@@ -353,7 +353,7 @@ func TestDominantResourceShare(t *testing.T) {
 				).Obj(),
 			lendingClusterQueue: utiltesting.MakeClusterQueue("lending-cq").
 				Cohort("test-cohort").
-				FairWeight(oneQuantity).
+				FairWeight(resource.MustParse("1")).
 				ResourceGroup(
 					*utiltesting.MakeFlavorQuotas("default").
 						ResourceQuotaWrapper("cpu").NominalQuota("8").Append().
@@ -392,7 +392,7 @@ func TestDominantResourceShare(t *testing.T) {
 			},
 			clusterQueue: utiltesting.MakeClusterQueue("cq").
 				Cohort("test-cohort").
-				FairWeight(oneQuantity).
+				FairWeight(resource.MustParse("1")).
 				ResourceGroup(
 					*utiltesting.MakeFlavorQuotas("on-demand").
 						ResourceQuotaWrapper("cpu").NominalQuota("20").Append().
@@ -403,7 +403,7 @@ func TestDominantResourceShare(t *testing.T) {
 				).Obj(),
 			lendingClusterQueue: utiltesting.MakeClusterQueue("lending-cq").
 				Cohort("test-cohort").
-				FairWeight(oneQuantity).
+				FairWeight(resource.MustParse("1")).
 				ResourceGroup(
 					*utiltesting.MakeFlavorQuotas("default").
 						ResourceQuotaWrapper("cpu").NominalQuota("100").Append().
@@ -447,7 +447,7 @@ func TestDominantResourceShare(t *testing.T) {
 				).Obj(),
 			lendingClusterQueue: utiltesting.MakeClusterQueue("lending-cq").
 				Cohort("test-cohort").
-				FairWeight(oneQuantity).
+				FairWeight(resource.MustParse("1")).
 				ResourceGroup(
 					*utiltesting.MakeFlavorQuotas("default").
 						ResourceQuotaWrapper("example.com/gpu").NominalQuota("5").Append().
@@ -488,7 +488,7 @@ func TestDominantResourceShare(t *testing.T) {
 				).Obj(),
 			lendingClusterQueue: utiltesting.MakeClusterQueue("lending-cq").
 				Cohort("test-cohort").
-				FairWeight(oneQuantity).
+				FairWeight(resource.MustParse("1")).
 				ResourceGroup(
 					*utiltesting.MakeFlavorQuotas("default").
 						ResourceQuotaWrapper("example.com/gpu").NominalQuota("5").Append().
@@ -529,7 +529,7 @@ func TestDominantResourceShare(t *testing.T) {
 				).Obj(),
 			lendingClusterQueue: utiltesting.MakeClusterQueue("lending-cq").
 				Cohort("test-cohort").
-				FairWeight(oneQuantity).
+				FairWeight(resource.MustParse("1")).
 				ResourceGroup(
 					*utiltesting.MakeFlavorQuotas("default").
 						ResourceQuotaWrapper("example.com/gpu").NominalQuota("10").Append().
@@ -562,7 +562,7 @@ func TestDominantResourceShare(t *testing.T) {
 			},
 			clusterQueue: utiltesting.MakeClusterQueue("cq").
 				Cohort("child-cohort").
-				FairWeight(oneQuantity).
+				FairWeight(resource.MustParse("1")).
 				ResourceGroup(
 					*utiltesting.MakeFlavorQuotas("default").
 						ResourceQuotaWrapper("example.com/gpu").NominalQuota("5").Append().
@@ -603,7 +603,7 @@ func TestDominantResourceShare(t *testing.T) {
 			},
 			clusterQueue: utiltesting.MakeClusterQueue("cq").
 				Cohort("child-cohort").
-				FairWeight(oneQuantity).
+				FairWeight(resource.MustParse("1")).
 				ResourceGroup(
 					*utiltesting.MakeFlavorQuotas("default").
 						ResourceQuotaWrapper("example.com/gpu").NominalQuota("0").Append().
diff --git a/pkg/cache/scheduler/snapshot_test.go b/pkg/cache/scheduler/snapshot_test.go
index a0e78eef0..c5c0d058b 100644
--- a/pkg/cache/scheduler/snapshot_test.go
+++ b/pkg/cache/scheduler/snapshot_test.go
@@ -81,7 +81,7 @@ func TestSnapshot(t *testing.T) {
 										ReserveQuota(&kueue.Admission{ClusterQueue: "a"}).Obj()),
 							},
 							Preemption: defaultPreemption,
-							FairWeight: oneQuantity,
+							FairWeight: defaultWeight,
 						},
 						"b": {
 							Name:                          "b",
@@ -95,7 +95,7 @@ func TestSnapshot(t *testing.T) {
 										ReserveQuota(&kueue.Admission{ClusterQueue: "b"}).Obj()),
 							},
 							Preemption: defaultPreemption,
-							FairWeight: oneQuantity,
+							FairWeight: defaultWeight,
 						},
 					},
 				),
@@ -271,7 +271,7 @@ func TestSnapshot(t *testing.T) {
 										Obj()),
 								},
 								Preemption:        defaultPreemption,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								NamespaceSelector: labels.Everything(),
 								Status:            active,
 							},
@@ -334,7 +334,7 @@ func TestSnapshot(t *testing.T) {
 										Obj()),
 								},
 								Preemption:        defaultPreemption,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								NamespaceSelector: labels.Everything(),
 								Status:            active,
 							},
@@ -358,7 +358,7 @@ func TestSnapshot(t *testing.T) {
 								},
 								FlavorFungibility: defaultFlavorFungibility,
 								Preemption:        defaultPreemption,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								NamespaceSelector: labels.Everything(),
 								Status:            active,
 							},
@@ -395,7 +395,7 @@ func TestSnapshot(t *testing.T) {
 								ReclaimWithinCohort: kueue.PreemptionPolicyAny,
 								WithinClusterQueue:  kueue.PreemptionPolicyLowerPriority,
 							},
-							FairWeight: oneQuantity,
+							FairWeight: defaultWeight,
 						},
 					},
 				),
@@ -417,7 +417,7 @@ func TestSnapshot(t *testing.T) {
 							Workloads:                     map[workload.Reference]*workload.Info{},
 							FlavorFungibility:             defaultFlavorFungibility,
 							Preemption:                    defaultPreemption,
-							FairWeight:                    resource.MustParse("3"),
+							FairWeight:                    3.0,
 						},
 					},
 				),
@@ -521,7 +521,7 @@ func TestSnapshot(t *testing.T) {
 									},
 								},
 								FlavorFungibility: defaultFlavorFungibility,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								Workloads: map[workload.Reference]*workload.Info{
 									"/alpha": workload.NewInfo(utiltesting.MakeWorkload("alpha", "").
 										PodSets(*utiltesting.MakePodSet(kueue.DefaultPodSetName, 5).
@@ -580,7 +580,7 @@ func TestSnapshot(t *testing.T) {
 									Usage: resources.FlavorResourceQuantities{},
 								},
 								FlavorFungibility: defaultFlavorFungibility,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								Preemption:        defaultPreemption,
 								NamespaceSelector: labels.Everything(),
 								Status:            active,
@@ -694,7 +694,7 @@ func TestSnapshot(t *testing.T) {
 									},
 								},
 								FlavorFungibility: defaultFlavorFungibility,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								Workloads: map[workload.Reference]*workload.Info{
 									"/alpha": workload.NewInfo(utiltesting.MakeWorkload("alpha", "").
 										PodSets(*utiltesting.MakePodSet(kueue.DefaultPodSetName, 5).
@@ -752,7 +752,7 @@ func TestSnapshot(t *testing.T) {
 									},
 								},
 								FlavorFungibility: defaultFlavorFungibility,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								Preemption:        defaultPreemption,
 								NamespaceSelector: labels.Everything(),
 								Status:            active,
@@ -808,7 +808,7 @@ func TestSnapshot(t *testing.T) {
 									{Flavor: "mips", Resource: corev1.ResourceCPU}: 42_000,
 								},
 							},
-							FairWeight: oneQuantity,
+							FairWeight: defaultWeight,
 						},
 					},
 					map[kueue.ClusterQueueReference]*ClusterQueueSnapshot{
@@ -832,7 +832,7 @@ func TestSnapshot(t *testing.T) {
 								},
 							},
 							FlavorFungibility: defaultFlavorFungibility,
-							FairWeight:        oneQuantity,
+							FairWeight:        defaultWeight,
 							Preemption:        defaultPreemption,
 							NamespaceSelector: labels.Everything(),
 							Status:            active,
@@ -888,7 +888,7 @@ func TestSnapshot(t *testing.T) {
 									{Flavor: "arm", Resource: corev1.ResourceCPU}: 0,
 								},
 							},
-							FairWeight: oneQuantity,
+							FairWeight: defaultWeight,
 						},
 					},
 					map[kueue.ClusterQueueReference]*ClusterQueueSnapshot{
@@ -910,7 +910,7 @@ func TestSnapshot(t *testing.T) {
 								},
 							},
 							FlavorFungibility: defaultFlavorFungibility,
-							FairWeight:        oneQuantity,
+							FairWeight:        defaultWeight,
 							Preemption:        defaultPreemption,
 							NamespaceSelector: labels.Everything(),
 							Status:            active,
@@ -932,7 +932,7 @@ func TestSnapshot(t *testing.T) {
 					map[kueue.CohortReference]*CohortSnapshot{
 						"cohort": {
 							Name:       "cohort",
-							FairWeight: resource.MustParse("0.5"),
+							FairWeight: 0.5,
 						},
 					},
 					map[kueue.ClusterQueueReference]*ClusterQueueSnapshot{},
@@ -1110,7 +1110,7 @@ func TestSnapshotAddRemoveWorkload(t *testing.T) {
 								Workloads:         make(map[workload.Reference]*workload.Info),
 								ResourceGroups:    cqCache.hm.ClusterQueue("c1").ResourceGroups,
 								FlavorFungibility: defaultFlavorFungibility,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{
 										{Flavor: "default", Resource: corev1.ResourceCPU}:  0,
@@ -1129,7 +1129,7 @@ func TestSnapshotAddRemoveWorkload(t *testing.T) {
 								Workloads:                     make(map[workload.Reference]*workload.Info),
 								ResourceGroups:                cqCache.hm.ClusterQueue("c2").ResourceGroups,
 								FlavorFungibility:             defaultFlavorFungibility,
-								FairWeight:                    oneQuantity,
+								FairWeight:                    defaultWeight,
 								AllocatableResourceGeneration: 1,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{
@@ -1173,7 +1173,7 @@ func TestSnapshotAddRemoveWorkload(t *testing.T) {
 								},
 								ResourceGroups:    cqCache.hm.ClusterQueue("c1").ResourceGroups,
 								FlavorFungibility: defaultFlavorFungibility,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{
 										{Flavor: "default", Resource: corev1.ResourceCPU}:  0,
@@ -1195,7 +1195,7 @@ func TestSnapshotAddRemoveWorkload(t *testing.T) {
 								},
 								ResourceGroups:                cqCache.hm.ClusterQueue("c2").ResourceGroups,
 								FlavorFungibility:             defaultFlavorFungibility,
-								FairWeight:                    oneQuantity,
+								FairWeight:                    defaultWeight,
 								AllocatableResourceGeneration: 1,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{
@@ -1239,7 +1239,7 @@ func TestSnapshotAddRemoveWorkload(t *testing.T) {
 								},
 								ResourceGroups:    cqCache.hm.ClusterQueue("c1").ResourceGroups,
 								FlavorFungibility: defaultFlavorFungibility,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{
 										{Flavor: "default", Resource: corev1.ResourceCPU}:  1_000,
@@ -1261,7 +1261,7 @@ func TestSnapshotAddRemoveWorkload(t *testing.T) {
 								},
 								ResourceGroups:    cqCache.hm.ClusterQueue("c2").ResourceGroups,
 								FlavorFungibility: defaultFlavorFungibility,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{
 										{Flavor: "default", Resource: corev1.ResourceCPU}: 2_000,
@@ -1418,7 +1418,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
 								Workloads:         make(map[workload.Reference]*workload.Info),
 								ResourceGroups:    cqCache.hm.ClusterQueue("lend-a").ResourceGroups,
 								FlavorFungibility: defaultFlavorFungibility,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{
 										{Flavor: "default", Resource: corev1.ResourceCPU}: 0,
@@ -1433,7 +1433,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
 								Workloads:         make(map[workload.Reference]*workload.Info),
 								ResourceGroups:    cqCache.hm.ClusterQueue("lend-b").ResourceGroups,
 								FlavorFungibility: defaultFlavorFungibility,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{
 										{Flavor: "default", Resource: corev1.ResourceCPU}: 0,
@@ -1471,7 +1471,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
 								Workloads:         make(map[workload.Reference]*workload.Info),
 								ResourceGroups:    cqCache.hm.ClusterQueue("lend-a").ResourceGroups,
 								FlavorFungibility: defaultFlavorFungibility,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{
 										{Flavor: "default", Resource: corev1.ResourceCPU}: 7_000,
@@ -1486,7 +1486,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
 								Workloads:                     make(map[workload.Reference]*workload.Info),
 								ResourceGroups:                cqCache.hm.ClusterQueue("lend-b").ResourceGroups,
 								FlavorFungibility:             defaultFlavorFungibility,
-								FairWeight:                    oneQuantity,
+								FairWeight:                    defaultWeight,
 								AllocatableResourceGeneration: 1,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{
@@ -1525,7 +1525,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
 								Workloads:         make(map[workload.Reference]*workload.Info),
 								ResourceGroups:    cqCache.hm.ClusterQueue("lend-a").ResourceGroups,
 								FlavorFungibility: defaultFlavorFungibility,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{
 										{Flavor: "default", Resource: corev1.ResourceCPU}: 6_000,
@@ -1540,7 +1540,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
 								Workloads:                     make(map[workload.Reference]*workload.Info),
 								ResourceGroups:                cqCache.hm.ClusterQueue("lend-b").ResourceGroups,
 								FlavorFungibility:             defaultFlavorFungibility,
-								FairWeight:                    oneQuantity,
+								FairWeight:                    defaultWeight,
 								AllocatableResourceGeneration: 1,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{
@@ -1579,7 +1579,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
 								Workloads:         make(map[workload.Reference]*workload.Info),
 								ResourceGroups:    cqCache.hm.ClusterQueue("lend-a").ResourceGroups,
 								FlavorFungibility: defaultFlavorFungibility,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{
 										{Flavor: "default", Resource: corev1.ResourceCPU}: 1_000,
@@ -1594,7 +1594,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
 								Workloads:                     make(map[workload.Reference]*workload.Info),
 								ResourceGroups:                cqCache.hm.ClusterQueue("lend-b").ResourceGroups,
 								FlavorFungibility:             defaultFlavorFungibility,
-								FairWeight:                    oneQuantity,
+								FairWeight:                    defaultWeight,
 								AllocatableResourceGeneration: 1,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{
@@ -1634,7 +1634,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
 								Workloads:         make(map[workload.Reference]*workload.Info),
 								ResourceGroups:    cqCache.hm.ClusterQueue("lend-a").ResourceGroups,
 								FlavorFungibility: defaultFlavorFungibility,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{
 										{Flavor: "default", Resource: corev1.ResourceCPU}: 1_000,
@@ -1649,7 +1649,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
 								Workloads:                     make(map[workload.Reference]*workload.Info),
 								ResourceGroups:                cqCache.hm.ClusterQueue("lend-b").ResourceGroups,
 								FlavorFungibility:             defaultFlavorFungibility,
-								FairWeight:                    oneQuantity,
+								FairWeight:                    defaultWeight,
 								AllocatableResourceGeneration: 1,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{
@@ -1689,7 +1689,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
 								Workloads:         make(map[workload.Reference]*workload.Info),
 								ResourceGroups:    cqCache.hm.ClusterQueue("lend-a").ResourceGroups,
 								FlavorFungibility: defaultFlavorFungibility,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{
 										{Flavor: "default", Resource: corev1.ResourceCPU}: 6_000,
@@ -1704,7 +1704,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
 								Workloads:         make(map[workload.Reference]*workload.Info),
 								ResourceGroups:    cqCache.hm.ClusterQueue("lend-b").ResourceGroups,
 								FlavorFungibility: defaultFlavorFungibility,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{
 										{Flavor: "default", Resource: corev1.ResourceCPU}: 0,
@@ -1743,7 +1743,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
 								Workloads:         make(map[workload.Reference]*workload.Info),
 								ResourceGroups:    cqCache.hm.ClusterQueue("lend-a").ResourceGroups,
 								FlavorFungibility: defaultFlavorFungibility,
-								FairWeight:        oneQuantity,
+								FairWeight:        defaultWeight,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{
 										{Flavor: "default", Resource: corev1.ResourceCPU}: 9_000,
@@ -1758,7 +1758,7 @@ func TestSnapshotAddRemoveWorkloadWithLendingLimit(t *testing.T) {
 								Workloads:                     make(map[workload.Reference]*workload.Info),
 								ResourceGroups:                cqCache.hm.ClusterQueue("lend-b").ResourceGroups,
 								FlavorFungibility:             defaultFlavorFungibility,
-								FairWeight:                    oneQuantity,
+								FairWeight:                    defaultWeight,
 								AllocatableResourceGeneration: 1,
 								ResourceNode: resourceNode{
 									Usage: resources.FlavorResourceQuantities{