File tree Expand file tree Collapse file tree 1 file changed +16
-11
lines changed
tests/integration/tools/atlas Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
22import { Session } from "../../../../src/session.js" ;
33import { describeWithAtlas , withProject , randomId } from "./atlasHelpers.js" ;
44import { expectDefined , getResponseElements } from "../../helpers.js" ;
5+ import { ApiClientError } from "../../../../src/common/atlas/apiClientError.js" ;
56
67describeWithAtlas ( "db users" , ( integration ) => {
78 withProject ( integration , ( { getProjectId } ) => {
@@ -28,18 +29,22 @@ describeWithAtlas("db users", (integration) => {
2829 } ;
2930
3031 afterEach ( async ( ) => {
31- const projectId = getProjectId ( ) ;
32-
33- const session : Session = integration . mcpServer ( ) . session ;
34- await session . apiClient . deleteDatabaseUser ( {
35- params : {
36- path : {
37- groupId : projectId ,
38- username : userName ,
39- databaseName : "admin" ,
32+ try {
33+ await integration . mcpServer ( ) . session . apiClient . deleteDatabaseUser ( {
34+ params : {
35+ path : {
36+ groupId : getProjectId ( ) ,
37+ username : userName ,
38+ databaseName : "admin" ,
39+ } ,
4040 } ,
41- } ,
42- } ) ;
41+ } ) ;
42+ } catch ( error ) {
43+ // Ignore 404 errors when deleting the user
44+ if ( ! ( error instanceof ApiClientError ) || error . response ?. status !== 404 ) {
45+ throw error ;
46+ }
47+ }
4348 } ) ;
4449
4550 describe ( "atlas-create-db-user" , ( ) => {
You can’t perform that action at this time.
0 commit comments