File tree Expand file tree Collapse file tree 3 files changed +6
-25
lines changed Expand file tree Collapse file tree 3 files changed +6
-25
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,6 @@ describe('sql', () => {
31
31
const id = uuid ( ) ;
32
32
const testData = getRandomTestData ( ) ;
33
33
34
- if ( ! poolConnection ) {
35
- throw new Error ( 'SQL connection pool is not initialized' ) ;
36
- }
37
-
38
34
// trigger by insert
39
35
await poolConnection ! . request ( ) . query ( `INSERT INTO ${ Sql . sqlTriggerTable } VALUES ('${ id } ', '${ testData } ');` ) ;
40
36
await waitForOutput ( `sqlTrigger processed 1 changes` ) ;
Original file line number Diff line number Diff line change 8
8
import { CosmosClient , PartitionKeyKind } from '@azure/cosmos' ;
9
9
import { cosmosDBConnectionString } from '../connectionStrings' ;
10
10
import { CosmosDB } from '../../constants' ;
11
- import { delay } from '../delay' ;
12
11
13
12
export async function setupCosmosDB ( ) {
14
- try {
15
13
const partitionKeyPath = `/${ CosmosDB . partitionKey } ` ;
16
14
if ( ! cosmosDBConnectionString ) {
17
15
throw new Error ( 'CosmosDB connection string is not set' ) ;
@@ -26,9 +24,4 @@ export async function setupCosmosDB() {
26
24
id : CosmosDB . triggerAndOutputContainerName ,
27
25
partitionKey : { paths : [ partitionKeyPath ] , kind : PartitionKeyKind . Hash }
28
26
} ) ;
29
- } catch ( error ) {
30
- console . error ( 'Error setting up CosmosDB:' , error ) ;
31
- throw error ;
32
- }
33
- await delay ( 30000 ) ;
34
27
}
Original file line number Diff line number Diff line change @@ -9,19 +9,14 @@ import { Sql } from '../../constants';
9
9
export async function runSqlSetupQueries ( ) {
10
10
// STEP 1: Create DB if not exists
11
11
let pool = await createPoolConnnection ( sqlConnectionString ) ;
12
- try {
13
- await pool . request ( ) . query ( `
14
- IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = '${ Sql . dbName } ')
15
- BEGIN
16
- CREATE DATABASE [${ Sql . dbName } ];
17
- END
18
- ` ) ;
19
- } finally {
20
- await pool . close ( ) ;
21
- }
12
+ await pool . request ( ) . query ( `
13
+ IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = '${ Sql . dbName } ')
14
+ BEGIN
15
+ CREATE DATABASE [${ Sql . dbName } ];
16
+ END
17
+ ` ) ;
22
18
23
19
// STEP 2: Retry ALTER DATABASE (change_tracking)
24
- pool = await createPoolConnnection ( sqlConnectionString ) ;
25
20
try {
26
21
await retry ( async ( currentAttempt ) => {
27
22
if ( currentAttempt > 1 ) {
@@ -44,9 +39,6 @@ export async function runSqlSetupQueries() {
44
39
retries : 5 ,
45
40
minTimeout : 5000
46
41
} ) ;
47
- } catch ( err ) {
48
- console . error ( "ALTER DATABASE failed:" , err ) ;
49
- throw err ;
50
42
} finally {
51
43
await pool . close ( ) ;
52
44
}
You can’t perform that action at this time.
0 commit comments