File tree 1 file changed +7
-1
lines changed
pkg/ccl/changefeedccl/cdctest
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import (
13
13
"fmt"
14
14
"math/rand"
15
15
"strings"
16
+ "time"
16
17
17
18
"github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/changefeedbase"
18
19
"github.com/cockroachdb/cockroach/pkg/internal/sqlsmith"
@@ -418,11 +419,16 @@ func RunNemesis(
418
419
419
420
defer queryGen .Close ()
420
421
const numInserts = 100
422
+ const insertTimeout = 5 * time .Second
421
423
time := timeutil .Now ()
422
424
for i := 0 ; i < numInserts ; i ++ {
423
425
query := queryGen .Generate ()
424
426
log .Infof (ctx , "Executing query: %s" , query )
425
- _ , err := db .Exec (query )
427
+ err := timeutil .RunWithTimeout (ctx , "nemeses populate table" ,
428
+ insertTimeout , func (ctx context.Context ) error {
429
+ _ , err := db .ExecContext (ctx , query )
430
+ return err
431
+ })
426
432
log .Infof (ctx , "Time taken to execute last query: %s" , timeutil .Since (time ))
427
433
time = timeutil .Now ()
428
434
if err != nil {
You can’t perform that action at this time.
0 commit comments