Skip to content

Commit ee235a4

Browse files
committed
Fix MacOS test problems
1 parent 52efa49 commit ee235a4

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

.github/workflows/nodejs.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
- name: Firebird install (MacOS)
4646
if: startsWith(matrix.os, 'macos-')
4747
run: |
48+
sudo chmod +a "everyone allow read,write,execute,delete,add_file,add_subdirectory,file_inherit,directory_inherit" /tmp
4849
wget -nv -O Firebird-5.0.3.1683-0-macos-arm64.pkg "https://github.com/FirebirdSQL/firebird/releases/download/v5.0.3/Firebird-5.0.3.1683-0-macos-arm64.pkg"
4950
sudo installer -verbose -pkg "Firebird-5.0.3.1683-0-macos-arm64.pkg" -target /
5051
@@ -70,11 +71,11 @@ jobs:
7071
- name: Test (MacOS)
7172
if: startsWith(matrix.os, 'macos-')
7273
run: |
73-
sudo mkdir `pwd`/tmp-node-fb
74-
sudo chmod 777 `pwd`/tmp-node-fb
74+
sudo mkdir /tmp/node-fb
75+
sudo chmod 777 /tmp/node-fb
7576
export ISC_USER=sysdba
7677
export ISC_PASSWORD=masterkey
77-
export NODE_FB_TEST_TMP_DIR=`pwd`/tmp-node-fb
78+
export NODE_FB_TEST_TMP_DIR=/tmp/node-fb
7879
corepack yarn test
7980
8081
- name: Test (Windows)

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)