Skip to content

Commit 6f27d84

Browse files
committed
test: use gdb to capture core on tests
gdb let us save core dumps on Linux (similar to what we do on OS X). For some reason, GitHub Actions are not generating system core dumps, so this is a good alternative to keep tests working when we move. PR-URL: #323 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent 9a58d8c commit 6f27d84

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/common.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,14 @@ function spawnWithTimeout(cmd, cb) {
247247
}
248248

249249
function saveCoreLinux(executable, scenario, core, cb) {
250-
const cmd = `ulimit -c unlimited && ${executable} ` +
251-
`--abort_on_uncaught_exception --expose_externalize_string ` +
252-
`${path.join(exports.fixturesDir, scenario)}; `;
250+
// TODO(mmarchini): Let users choose if they want system generated core dumps
251+
// or gdb generated core dumps.
252+
const cmd = `gdb ${executable} --batch -ex 'run ` +
253+
`--abort-on-uncaught-exception --expose-externalize-string ` +
254+
`${path.join(exports.fixturesDir, scenario)}' -ex 'generate-core-file ` +
255+
`${core}'`;
253256
spawnWithTimeout(cmd, () => {
254-
// FIXME (mmarchini): Should also handle different core system settings.
255-
spawnWithTimeout(`mv ./core ${core}`, cb);
257+
cb()
256258
});
257259
}
258260

0 commit comments

Comments
 (0)