You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: scheduler_nokit_test.go
    path of file: ./repos/tidb/pkg/disttask/framework/scheduler
    
    the code of the file until where you have to start completion: // Copyright 2024 PingCAP, Inc.
//
// 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,
// WITHO
    
func TestSchedulerNotAllocateSlots(t *testing.T) {
	ctrl := gomock.NewController(t)
	defer ctrl.Finish()
	taskMgr := mock.NewMockTaskManager(ctrl)

	// scheduler not allocated slots, task from paused to resuming. Should exit the scheduler.
	task := proto.Task{
		TaskBase: proto.TaskBase{
			ID:          int64(1),
			Concurrency: 1,
			Type:        proto.TaskTypeExample,
			State:       proto.TaskStatePaused,
		},
	}
	cloneTask := task
	sch := createScheduler(&cloneTask, false, taskMgr, ctrl)
	taskMgr.EXPECT().GetTaskBaseByID(gomock.Any(), cloneTask.ID).DoAndReturn(func(_ context.Context, _ int64) (*proto.TaskBase, error) {
		cloneTask.State = proto.TaskStateResuming
		return &cloneTask.TaskBase, nil
	})
	sch.scheduleTask()
	require.True(t, ctrl.Satisfied())

	// scheduler not allocated slots, task from paused to running. Should exit the scheduler.
	task.State = proto.TaskStatePaused
	cloneTask = task
	sch = createScheduler(&cloneTask, false, taskMgr, ctrl)
	taskMgr.EXPECT().GetTaskBaseByID(gomock.Any(), cloneTask.ID).DoAndReturn(func(_ context.Context, _ int64) (*proto.TaskBase, error) {
		cloneTask.State = proto.TaskStateRunning
		return &cloneTask.TaskBase, nil
	})
	sch.scheduleTask()
	require.True(t, ctrl.Satisfied())

	// scheduler not allocated slots, but won't exit the scheduler.
	task.State = proto.TaskStateReverting
	cloneTask = task

	sch = createScheduler(&cloneTask, false, taskMgr, ctrl)
	schExt := schmock.NewMockExtension(ctrl)
	sch.Extension = schExt
	schExt.EXPECT().OnDone(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil)
	taskMgr.EXPECT().GetTaskBaseByID(gomock.Any(), cloneTask.ID).DoAndReturn(func(_ context.Context, _ int64) (*proto.TaskBase, error) {
		return &cloneTask.TaskBase, nil
	})

	taskMgr.EXPECT().GetSubtaskCntGroupByStates(gomock.Any(), cloneTask.ID, cloneTask.Step).Return(map[proto.SubtaskState]int64{
		proto.SubtaskStatePending: 0,
		proto.SubtaskStateRunning: 0}, nil)
	taskMgr.EXPECT().RevertedTask(gomock.Any(), cloneTask.ID).Return(nil)
	taskMgr.EXPECT().GetTaskBaseByID(gomock.Any(), cloneTask.ID).DoAndReturn(func(_ context.Context, _ int64) (*proto.TaskBase, error) {
		cloneTask.State = proto.TaskStateReverted
		return &cloneTask.TaskBase, nil
	})
	sch.scheduleTask()
	require.True(t, ctrl.Satisfied())

	task.State = proto.TaskStatePausing
	cloneTask = task
	sch = createScheduler(&cloneTask, false, taskMgr, ctrl)
	schExt = schmock.NewMockExtension(ctrl)
	sch.Extension = schExt
	taskMgr.EXPECT().GetTaskBaseByID(gomock.Any(), cloneTask.ID).DoAndReturn(func(_ context.Context, _ int64) (*proto.TaskBase, error) {
		return &cloneTask.TaskBase, nil
	})
	taskMgr.EXPECT().GetSubtaskCntGroupByStates(gomock.Any(), cloneTask.ID, cloneTask.Step).Return(map[proto.SubtaskState]int64{
		proto.SubtaskStatePending: 0,
		proto.SubtaskStateRunning: 0}, nil)
	taskMgr.EXPECT().GetTaskBaseByID(gomock.Any(), cloneTask.ID).DoAndReturn(func(_ context.Context, _ int64) (*proto.TaskBase, error) {
		cloneTask.State = proto.TaskStatePaused
		return &cloneTask.TaskBase, nil
	})
	taskMgr.EXPECT().PausedTask(gomock.Any(), cloneTask.ID).Return(nil)
	sch.scheduleTask()
	require.True(t, ctrl.Satisfied())
}