Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuqi-lucas committed Sep 13, 2024
1 parent 79561b4 commit 9d9ef42
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/scheduler/objects/application_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ func TestAppStateTransitionEvents(t *testing.T) {
func TestAppStateTransitionMetrics(t *testing.T) { //nolint:funlen
queue := createQueue(t, "metrics")
metrics.GetSchedulerMetrics().Reset()
metrics.GetQueueMetrics("root.metrics").Reset()
// app-00001: New -> Resuming -> Accepted --> Running -> Completing-> Completed
app := newApplication("app-00001", "default", "root.metrics")
app.SetQueue(queue)
Expand Down
22 changes: 22 additions & 0 deletions pkg/scheduler/partition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ func TestRemoveNodeWithAllocations(t *testing.T) {
partition, err := newBasePartition()
assert.NilError(t, err, "partition create failed")

defer metrics.GetSchedulerMetrics().Reset()
defer metrics.GetQueueMetrics(defQueue).Reset()

// add a new app
app := newApplication(appID1, "default", defQueue)
err = partition.AddApplication(app)
Expand Down Expand Up @@ -294,6 +297,9 @@ func TestRemoveNodeWithPlaceholders(t *testing.T) {
partition, err := newBasePartition()
assert.NilError(t, err, "partition create failed")

defer metrics.GetSchedulerMetrics().Reset()
defer metrics.GetQueueMetrics(defQueue).Reset()

// add a new app
app := newApplication(appID1, "default", defQueue)
err = partition.AddApplication(app)
Expand Down Expand Up @@ -396,6 +402,9 @@ func TestPlaceholderDataWithPlaceholderPreemption(t *testing.T) {
partition, err := newBasePartition()
assert.NilError(t, err, "partition create failed")

defer metrics.GetSchedulerMetrics().Reset()
defer metrics.GetQueueMetrics(defQueue).Reset()

// add a new app1
app1, _ := newApplicationWithHandler(appID1, "default", defQueue)
err = partition.AddApplication(app1)
Expand Down Expand Up @@ -523,6 +532,9 @@ func TestPlaceholderDataWithNodeRemoval(t *testing.T) {
partition, err := newBasePartition()
assert.NilError(t, err, "partition create failed")

defer metrics.GetSchedulerMetrics().Reset()
defer metrics.GetQueueMetrics(defQueue).Reset()

// add a new app1
app1, _ := newApplicationWithHandler(appID1, "default", defQueue)
err = partition.AddApplication(app1)
Expand Down Expand Up @@ -606,6 +618,9 @@ func TestPlaceholderDataWithRemoval(t *testing.T) {
partition, err := newBasePartition()
assert.NilError(t, err, "partition create failed")

defer metrics.GetSchedulerMetrics().Reset()
defer metrics.GetQueueMetrics(defQueue).Reset()

// add a new app1
app1, _ := newApplicationWithHandler(appID1, "default", defQueue)
err = partition.AddApplication(app1)
Expand Down Expand Up @@ -699,6 +714,8 @@ func TestRemoveNodeWithReplacement(t *testing.T) {
partition, err := newBasePartition()
assert.NilError(t, err, "partition create failed")

defer metrics.GetSchedulerMetrics().Reset()
defer metrics.GetQueueMetrics(defQueue).Reset()
// add a new app
app := newApplication(appID1, "default", defQueue)
err = partition.AddApplication(app)
Expand Down Expand Up @@ -771,6 +788,9 @@ func TestRemoveNodeWithReal(t *testing.T) {
partition, err := newBasePartition()
assert.NilError(t, err, "partition create failed")

defer metrics.GetSchedulerMetrics().Reset()
defer metrics.GetQueueMetrics(defQueue).Reset()

// add a new app
app := newApplication(appID1, "default", defQueue)
err = partition.AddApplication(app)
Expand Down Expand Up @@ -832,6 +852,8 @@ func TestRemoveNodeWithReal(t *testing.T) {
}

func TestAddApp(t *testing.T) {
defer metrics.GetSchedulerMetrics().Reset()
defer metrics.GetQueueMetrics(defQueue).Reset()
partition, err := newBasePartition()
assert.NilError(t, err, "partition create failed")

Expand Down

0 comments on commit 9d9ef42

Please sign in to comment.