Skip to content

Commit 1152304

Browse files
Increase debezium-sqlserver init script wait time to 30 seconds
1 parent 7cf8617 commit 1152304

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

integration-test-groups/debezium/mssql/src/test/resources/initSqlserver.sql

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@
1919
CREATE DATABASE testDB;
2020

2121
USE testDB;
22+
23+
-- sql agent is started by providing of the system property, but it could happen that it is still starting during this
24+
-- execution. In that case, this script fails during setting of cdc for table. In case of failure because of:
25+
-- 'The error returned was 14258: Cannot perform this operation while SQLServerAgent is starting.'
26+
-- please increase following delay accordingly
27+
WAITFOR DELAY '00:00:30'
28+
2229
EXEC sys.sp_cdc_enable_db;
2330

2431
CREATE SCHEMA Test;
@@ -28,11 +35,6 @@ CREATE TABLE Test.COMPANY(
2835
CITY varchar(255),
2936
PRIMARY KEY (NAME)
3037
);
31-
-- sql agent is started by providing of the system property, but it could happen that it is still starting during this
32-
-- execution. In that case, this script fails during setting of cdc for table. In case of failure because of:
33-
-- 'The error returned was 14258: Cannot perform this operation while SQLServerAgent is starting.'
34-
-- please increase following delay accordingly
35-
WAITFOR DELAY '00:00:10'
3638

3739
EXEC sys.sp_cdc_enable_table @source_schema=N'Test', @source_name=N'COMPANY', @role_name = NULL,@filegroup_name=N'PRIMARY', @supports_net_changes=0;
3840
INSERT INTO Test.COMPANY (name, city) VALUES ('init', 'init');

0 commit comments

Comments
 (0)