8000 Refactor how sanitizer logs paths are maintained... (#20647) · 0ArtemBabaev/arangodb@8ec844a · GitHub
[go: up one dir, main page]

Skip to content

Commit 8ec844a

Browse files
authored
Refactor how sanitizer logs paths are maintained... (arangodb#20647)
* Refactor how sanitizer logs paths are maintained and make sure report files are written to the path that was originally configured in the sanitizer options * Remove now obsolete step * Fix stuff
1 parent 6d65d54 commit 8ec844a

File tree

2 files changed

+23
-26
lines changed

2 files changed

+23
-26
lines changed

.circleci/base_config.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -332,17 +332,6 @@ jobs:
332332
--cluster << parameters.cluster >> \
333333
--extraArgs " << parameters.extraArgs >>" \
334334
--definition tests/test-definitions.txt
335-
- when:
336-
condition: << pipeline.parameters.sanitizer >> != ""
337-
steps:
338-
- run:
339-
name: Gather sanitizer logs
340-
when: always
341-
command: |
342-
# testing.js adjusts the sanitizer log path for each instance and then copies them to
343-
# the project root folder, so we have to move them to the work folder manually
344-
ls -la
345-
find . -maxdepth 1 -name '*san.log.*' -type f -print0 | xargs -0r mv -t ./work/
346335
- run:
347336
name: Copy test results
348337
when: always

js/client/modules/@arangodb/testutils/instance.js

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class instance {
226226
this.jwtFiles = null;
227227

228228
this.sanOptions = _.clone(this.options.sanOptions);
229-
this.sanFiles = [];
229+
this.sanitizerLogPaths = {};
230230

231231
this._makeArgsArangod();
232232

@@ -473,8 +473,9 @@ class instance {
473473
}
474474
for (const [key, value] of Object.entries(this.sanOptions)) {
475475
let oneLogFile = fs.join(rootDir, key.toLowerCase().split('_')[0] + '.log');
476+
const origPath = this.sanOptions[key]['log_path'];
476477
this.sanOptions[key]['log_path'] = oneLogFile;
477-
this.sanFiles.push(oneLogFile);
478+
this.sanitizerLogPaths[key] = { upstream: origPath, local: oneLogFile };
478479
}
479480
}
480481
}
@@ -789,23 +790,30 @@ class instance {
789790
};
790791

791792
fetchSanFileAfterExit() {
792-
if (this.options.isSan) {
793-
this.sanFiles.forEach(fileName => {
794-
let fn = `${fileName}.arangod.${this.pid}`;
795-
if (this.options.extremeVerbosity) {
796-
print(`checking for ${fn}: ${fs.exists(fn)}`);
793+
if (!this.options.isSan) {
794+
return;
795+
}
796+
797+
for (const [key, value] of Object.entries(this.sanitizerLogPaths)) {
798+
const { upstream, local } = value;
799+
let fn = `${local}.arangod.${this.pid}`;
800+
if (this.options.extremeVerbosity) {
801+
print(`checking for ${fn}: ${fs.exists(fn)}`);
802+
}
803+
if (fs.exists(fn)) {
804+
let content = fs.read(fn);
805+
if (upstream) {
806+
fs.write(`${upstream}.arangod.${this.pid}`, content);
797807
}
798-
if (fs.exists(fn)) {
799-
let content = fs.read(fn);
800-
if (content.length > 10) {
801-
crashUtils.GDB_OUTPUT += `Report of '${this.name}' in ${fn} contains: \n`;
802-
crashUtils.GDB_OUTPUT += content;
803-
this.serverCrashedLocal = true;
804-
}
808+
if (content.length > 10) {
809+
crashUtils.GDB_OUTPUT += `Report of '${this.name}' in ${fn} contains: \n`;
810+
crashUtils.GDB_OUTPUT += content;
811+
this.serverCrashedLocal = true;
805812
}
806-
});
813+
}
807814
}
808815
}
816+
809817
waitForExitAfterDebugKill() {
810818
// Crashutils debugger kills our instance, but we neet to get
811819
// testing.js sapwned-PID-monitoring adjusted.

0 commit comments

Comments
 (0)
0