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: tasks_test.go
    path of file: ./repos/chaos-mesh/pkg/chaosdaemon/tasks
    
    the code of the file until where you have to start completion: // Copyright 2021 Chaos Mesh Authors.
//
// Licensed under the Ap
    
func TestTasksManagerError(t *testing.T) {
	var log logr.Logger

	zapLog, err := zap.NewDevelopment()
	if err != nil {
		panic(fmt.Sprintf("who watches the watchmen (%v)?", err))
	}
	log = zapr.NewLogger(zapLog)

	m := NewTaskManager(log)

	chaos := FakeChaos{
		ErrWhenRecover: false,
		ErrWhenInject:  false,
		logger:         log,
	}
	task1 := FakeConfig{i: 1}
	uid1 := "1"
	err = m.Create(uid1, SysPID(1), &task1, &chaos)
	assert.NoError(t, err)
	err = m.Apply(uid1, SysPID(1), &task1)
	assert.Equal(t, errors.Cause(err), cerr.ErrDuplicateEntity)
	err = m.Recover(uid1, SysPID(1))
	assert.NoError(t, err)
	err = m.Recover(uid1, SysPID(1))
	assert.Equal(t, errors.Cause(err), ErrNotFoundTaskID.Err())

	chaos.ErrWhenInject = true
	tasks2 := FakeConfig{i: 1}
	err = m.Create(uid1, SysPID(1), &tasks2, &chaos)
	assert.Equal(t, errors.Cause(err).Error(), cerr.NotImpl[Injectable]().Err().Error())
	_, err = m.GetConfigWithUID(uid1)
	assert.Equal(t, errors.Cause(err), ErrNotFoundTaskID.Err())

	chaos.ErrWhenInject = false
	chaos.ErrWhenRecover = true
	tasks3 := FakeConfig{i: 1}
	err = m.Create(uid1, SysPID(1), &tasks3, &chaos)
	assert.NoError(t, err)
	err = m.Recover(uid1, SysPID(1))
	assert.Equal(t, errors.Cause(err).Error(), cerr.NotImpl[Recoverable]().Err().Error())
	p, err := m.GetTaskWithPID(SysPID(1))
	inner := p.(*FakeChaos)
	inner.ErrWhenRecover = false
	err = m.Recover(uid1, SysPID(1))
	assert.NoError(t, err)
}