Skip to content

Commit

Permalink
update unit test to look for gpuType in worker pool
Browse files Browse the repository at this point in the history
  • Loading branch information
nickpetrovic committed Jan 19, 2024
1 parent 32d9e20 commit 64e6e67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/scheduler/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func NewSchedulerForTest() (*Scheduler, error) {
return nil, err
}

poolJson := []byte(`{"worker":{"pools":{"beam-cpu":{},"beam-a10g":{},"beam-t4":{}}}}}`)
poolJson := []byte(`{"worker":{"pools":{"beam-cpu":{},"beam-a10g":{"gpuType": "A10G"},"beam-t4":{"gpuType": "T4"}}}}}`)
configManager.LoadConfig(common.YAMLConfigFormat, rawbytes.Provider(poolJson))
config := configManager.GetConfig()

Expand Down Expand Up @@ -192,9 +192,9 @@ func TestGetController(t *testing.T) {
wb, _ := NewSchedulerForTest()

cpuRequest := &types.ContainerRequest{Gpu: ""}
cpuController, err := wb.getController(cpuRequest)
if err != nil || cpuController.Name() != "beam-cpu" {
t.Errorf("Expected beam-cpu controller, got %v, error: %v", cpuController, err)
defaultController, err := wb.getController(cpuRequest)
if err != nil || defaultController.Name() != "default" {
t.Errorf("Expected default controller, got %v, error: %v", defaultController, err)
}

a10gRequest := &types.ContainerRequest{Gpu: "A10G"}
Expand Down

0 comments on commit 64e6e67

Please sign in to comment.