Details
-
Task
-
Resolution: Unresolved
-
Major
-
None
-
None
-
False
-
None
-
False
Description
As our SQL Server test suite has continued to grow, the duration of the test execution for the connector has grown substantially, currently being one of the longest-running test suites across our entire project. In the long term, this isn't sustainable.
Looking at the time spent per stage in a standard SQL Server test, there are approximately 5-8 seconds consumed when executing the following SQL:
private static final String ENABLE_TABLE_CDC = "IF EXISTS(select 1 from sys.tables where name = '#' AND is_tracked_by_cdc=0)\n" + "EXEC sys.sp_cdc_enable_table @source_schema = N'%', @source_name = N'#', @role_name = NULL, @supports_net_changes = 0";
If this happens within a beforeEach or within each annotated test method, this can add up to substantial time wasted.
I'd propose to see whether we can find a solution to either reduce the time consumed by the sp_cdc_enable_table stored procedure or we re-evaluate the layout of our tests to minimize the number of times this function is called.