This is an automated email from the ASF dual-hosted git repository.

leonard pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink-cdc.git


The following commit(s) were added to refs/heads/master by this push:
     new 920fab95c [FLINK-38593][test][sqlserver] Fix unstable sqlserver e2e 
tests via adding more time to wait SqlserverAgent Ready
920fab95c is described below

commit 920fab95cef7fc19f1c209c4bdf55975f2603a61
Author: Leonard Xu <[email protected]>
AuthorDate: Thu Oct 30 19:21:04 2025 +0800

    [FLINK-38593][test][sqlserver] Fix unstable sqlserver e2e tests via adding 
more time to wait SqlserverAgent Ready
    
    This closes  #4167.
---
 .../src/test/resources/ddl/column_type_test.sql                     | 5 +++++
 .../src/test/resources/ddl/customer.sql                             | 5 +++++
 .../src/test/resources/ddl/inventory.sql                            | 5 +++++
 .../flink-connector-sqlserver-cdc/src/test/resources/ddl/pk.sql     | 5 +++++
 .../src/test/resources/ddl/product.sql                              | 5 +++++
 .../src/test/resources/ddl/sqlserver_inventory.sql                  | 6 ++++++
 6 files changed, 31 insertions(+)

diff --git 
a/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/column_type_test.sql
 
b/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/column_type_test.sql
index c3b77de67..620145785 100644
--- 
a/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/column_type_test.sql
+++ 
b/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/column_type_test.sql
@@ -20,6 +20,11 @@
 CREATE DATABASE column_type_test;
 
 USE column_type_test;
+
+-- Avoid SqlServer error com.microsoft.sqlserver.jdbc.SQLServerException: 
Could not update the metadata that indicates,
+-- the root cause is 14258: 'Cannot perform this operation while 
SQLServerAgent is starting. Try again later.'. We simply
+-- wait for 3 seconds to improve the test stabilises.
+WAITFOR DELAY '00:00:03';
 EXEC sys.sp_cdc_enable_db;
 
 CREATE TABLE full_types (
diff --git 
a/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/customer.sql
 
b/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/customer.sql
index 9ccb43f79..d924e0788 100644
--- 
a/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/customer.sql
+++ 
b/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/customer.sql
@@ -21,6 +21,11 @@
 CREATE DATABASE customer;
 
 USE customer;
+
+-- Avoid SqlServer error com.microsoft.sqlserver.jdbc.SQLServerException: 
Could not update the metadata that indicates,
+-- the root cause is 14258: 'Cannot perform this operation while 
SQLServerAgent is starting. Try again later.'. We simply
+-- wait for 3 seconds to improve the test stabilises.
+WAITFOR DELAY '00:00:03';
 EXEC sys.sp_cdc_enable_db;
 
 CREATE TABLE customers (
diff --git 
a/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/inventory.sql
 
b/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/inventory.sql
index 13c622b6e..e1b1cc838 100644
--- 
a/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/inventory.sql
+++ 
b/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/inventory.sql
@@ -20,6 +20,11 @@
 CREATE DATABASE inventory;
 
 USE inventory;
+
+-- Avoid SqlServer error com.microsoft.sqlserver.jdbc.SQLServerException: 
Could not update the metadata that indicates,
+-- the root cause is 14258: 'Cannot perform this operation while 
SQLServerAgent is starting. Try again later.'. We simply
+-- wait for 3 seconds to improve the test stabilises.
+WAITFOR DELAY '00:00:03';
 EXEC sys.sp_cdc_enable_db;
 
 -- Create and populate our products using a single insert with many rows
diff --git 
a/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/pk.sql
 
b/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/pk.sql
index 3986a75be..2f3a264a0 100644
--- 
a/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/pk.sql
+++ 
b/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/pk.sql
@@ -16,6 +16,11 @@
 CREATE DATABASE pk;
 
 USE pk;
+
+-- Avoid SqlServer error com.microsoft.sqlserver.jdbc.SQLServerException: 
Could not update the metadata that indicates,
+-- the root cause is 14258: 'Cannot perform this operation while 
SQLServerAgent is starting. Try again later.'. We simply
+-- wait for 3 seconds to improve the test stabilises.
+WAITFOR DELAY '00:00:03';
 EXEC sys.sp_cdc_enable_db;
 
 CREATE TABLE dt_pk (
diff --git 
a/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/product.sql
 
b/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/product.sql
index b45312845..7fcf5ead9 100644
--- 
a/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/product.sql
+++ 
b/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-sqlserver-cdc/src/test/resources/ddl/product.sql
@@ -20,6 +20,11 @@
 CREATE DATABASE product;
 
 USE product;
+
+-- Avoid SqlServer error com.microsoft.sqlserver.jdbc.SQLServerException: 
Could not update the metadata that indicates,
+-- the root cause is 14258: 'Cannot perform this operation while 
SQLServerAgent is starting. Try again later.'. We simply
+-- wait for 3 seconds to improve the test stabilises.
+WAITFOR DELAY '00:00:03';
 EXEC sys.sp_cdc_enable_db;
 
 CREATE TABLE products (
diff --git 
a/flink-cdc-e2e-tests/flink-cdc-source-e2e-tests/src/test/resources/ddl/sqlserver_inventory.sql
 
b/flink-cdc-e2e-tests/flink-cdc-source-e2e-tests/src/test/resources/ddl/sqlserver_inventory.sql
index 30fc40838..2b175af93 100644
--- 
a/flink-cdc-e2e-tests/flink-cdc-source-e2e-tests/src/test/resources/ddl/sqlserver_inventory.sql
+++ 
b/flink-cdc-e2e-tests/flink-cdc-source-e2e-tests/src/test/resources/ddl/sqlserver_inventory.sql
@@ -22,6 +22,12 @@ DATABASE inventory;
 
 USE
 inventory;
+
+-- Avoid SqlServer error com.microsoft.sqlserver.jdbc.SQLServerException: 
Could not update the metadata that indicates,
+-- the root cause is 14258: 'Cannot perform this operation while 
SQLServerAgent is starting. Try again later.'. We simply
+-- wait for 10 seconds to improve the e2e test stabilises.
+WAITFOR DELAY '00:00:10';
+
 EXEC sys.sp_cdc_enable_db;
 
 -- Create and populate our products using a single insert with many rows

Reply via email to