Skip to content

Commit dfef149

Browse files
committed
Workaround for MacOS
1 parent d5777a8 commit dfef149

File tree

1 file changed

+13
-4
lines changed
  • packages/node-firebird-native-api/src/test

1 file changed

+13
-4
lines changed

packages/node-firebird-native-api/src/test/test.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as fs from 'fs-extra-promise';
2+
import * as os from 'os';
23
import * as tmp from 'temp-fs';
34

4-
import { disposeMaster, getDefaultLibraryFilename, getMaster, Master, Provider, Util } from '../lib';
5-
import { XpbBuilder } from '../lib';
5+
import { disposeMaster, getDefaultLibraryFilename, getMaster, Master, Provider, Util, XpbBuilder } from '../lib';
66

77
// eslint-disable-next-line @typescript-eslint/no-require-imports
88
require('dotenv').config({ path: '../../.env', quiet: true });
@@ -59,8 +59,17 @@ describe('node-firebird-native-api', () => {
5959

6060
const status = master.getStatusSync()!;
6161
const fb_shutrsn_app_stopped = -3;
62-
dispatcher.shutdownSync(status, 0, fb_shutrsn_app_stopped);
63-
status.disposeSync();
62+
try {
63+
// FIXME: Why is this throwing in MacOS?
64+
dispatcher.shutdownSync(status, 0, fb_shutrsn_app_stopped);
65+
} catch (error) {
66+
const message = error instanceof Error ? error.message : String(error);
67+
if (os.platform() !== 'darwin' && !message.includes('connection shutdown')) {
68+
throw error;
69+
}
70+
} finally {
71+
status.disposeSync();
72+
}
6473

6574
dispatcher.releaseSync();
6675

0 commit comments

Comments
 (0)