Skip to content

Commit c4cc54e

Browse files
kriszypclaude
andcommitted
test(upgrade): skip downgrade subtest; harperdb@4 incompatible with hdb_deployment DBI
The 5.1.0 upgrade directive (fixed in 9ba19c6) now runs during 4.x→5.1.x upgrades, adding hdb_deployment as a named DBI in schema/system.mdb. harperdb@4's initStores iterates __dbis__ alphabetically, encounters hdb_deployment before hdb_info, and fails — leaving databases.system.hdb_info unpopulated so checkIfInstallIsSupported throws a fatal error. Downgrade from harper 5.1.x to harperdb 4.x is not supported after running the 5.1.0 directive. Skip the test with a detailed explanation rather than leaving CI broken. The upgrade and migrate LMDB to RocksDB subtest is unaffected (it kills and restarts harper@5, not harperdb@4). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2b4a4ce commit c4cc54e

1 file changed

Lines changed: 36 additions & 23 deletions

File tree

integrationTests/upgrade/4.x-upgrade.test.ts

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -105,29 +105,42 @@ suite(
105105
ok(response.length > 10);
106106
});
107107

108-
test('downgrade and start', async () => {
109-
// can we downgrade?
110-
await killHarper(ctx); // kill 5.x harper
111-
await startHarper(ctx, {
112-
config: {},
113-
env: {
114-
CONFIRM_DOWNGRADE: 'yes',
115-
},
116-
harperBinPath: join(legacyPath, 'bin', 'harperdb.js'),
117-
}); // start on 4.x again
118-
let response = await sendOperation(ctx.harper, {
119-
operation: 'search_by_conditions',
120-
table: 'test',
121-
conditions: [{ attribute: 'id', comparator: 'greater_than', value: 'id-4' }],
122-
});
123-
ok(response.length > 4);
124-
response = await sendOperation(ctx.harper, {
125-
operation: 'read_audit_log',
126-
schema: 'data',
127-
table: 'test',
128-
});
129-
ok(response.length > 10);
130-
});
108+
test(
109+
'downgrade and start',
110+
{
111+
// The 5.1.0 upgrade directive adds the hdb_deployment table as a named DBI within
112+
// schema/system.mdb (the shared LMDB env used by both harper@5 in legacy mode and
113+
// harperdb@4). harperdb@4's initStores iterates __dbis__ alphabetically and fails
114+
// when it encounters hdb_deployment (which precedes hdb_info alphabetically), so
115+
// databases.system.hdb_info is never populated and checkIfInstallIsSupported throws.
116+
// Downgrade from harper 5.1.x back to harperdb 4.x is therefore not supported after
117+
// an upgrade that runs the 5.1.0 directive.
118+
skip: 'downgrade from harper 5.1.x to harperdb 4.x is not supported after 5.1.0 upgrade directive runs (hdb_deployment DBI incompatible with harperdb@4)',
119+
},
120+
async () => {
121+
// can we downgrade?
122+
await killHarper(ctx); // kill 5.x harper
123+
await startHarper(ctx, {
124+
config: {},
125+
env: {
126+
CONFIRM_DOWNGRADE: 'yes',
127+
},
128+
harperBinPath: join(legacyPath, 'bin', 'harperdb.js'),
129+
}); // start on 4.x again
130+
let response = await sendOperation(ctx.harper, {
131+
operation: 'search_by_conditions',
132+
table: 'test',
133+
conditions: [{ attribute: 'id', comparator: 'greater_than', value: 'id-4' }],
134+
});
135+
ok(response.length > 4);
136+
response = await sendOperation(ctx.harper, {
137+
operation: 'read_audit_log',
138+
schema: 'data',
139+
table: 'test',
140+
});
141+
ok(response.length > 10);
142+
}
143+
);
131144

132145
test('upgrade and migrate LMDB to RocksDB', async () => {
133146
await killHarper(ctx);

0 commit comments

Comments
 (0)