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: db_change_failpoints_test.go
    path of file: ./repos/tidb/pkg/ddl
    
    the code of the file until where you have to start completion: // Copyright 2022 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
    
func TestParallelUpdateTableReplica(t *testing.T) {
	require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/pkg/infoschema/mockTiFlashStoreCount", `return(true)`))
	defer func() {
		require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/infoschema/mockTiFlashStoreCount"))
	}()

	store, dom := testkit.CreateMockStoreAndDomain(t)

	tk := testkit.NewTestKit(t, store)
	tk.MustExec("create database test_db_state default charset utf8 default collate utf8_bin")
	tk.MustExec("use test_db_state")
	tk.MustExec("drop table if exists t1;")
	tk.MustExec("create table t1 (a int);")
	tk.MustExec("alter table t1 set tiflash replica 3 location labels 'a','b';")

	tk1, tk2, ch, originalCallback := prepareTestControlParallelExecSQL(t, store, dom)
	defer dom.DDL().SetHook(originalCallback)

	t1 := external.GetTableByName(t, tk, "test_db_state", "t1")

	var err1 error
	var err2 error
	var wg util.WaitGroupWrapper
	wg.Run(func() {
		// Mock for table tiflash replica was available.
		err1 = domain.GetDomain(tk1.Session()).DDL().UpdateTableReplicaInfo(tk1.Session(), t1.Meta().ID, true)
	})
	wg.Run(func() {
		<-ch
		// Mock for table tiflash replica was available.
		err2 = domain.GetDomain(tk2.Session()).DDL().UpdateTableReplicaInfo(tk2.Session(), t1.Meta().ID, true)
	})
	wg.Wait()
	require.NoError(t, err1)
	require.EqualError(t, err2, "[ddl:-1]the replica available status of table t1 is already updated")
}