Skip to content

Commit

Permalink
Add comment and remove old code related to issue with shell executions
Browse files Browse the repository at this point in the history
  • Loading branch information
sungshik committed Sep 16, 2024
1 parent 5b9abd1 commit 53fe327
Showing 1 changed file with 5 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ bool doTransformTest(list[ConversionUnit] units, RepositoryStats expect, str nam
resolveLocation(lTest).path[(windows ? 1 : 0)..]
];

// TODO: The following function serves as a workaround for a race
// in (the Java-part of) the implementation of `execWithCode`. A fix is
// already available but not yet released. When it is, this function
// should be removed (and `execWithCode` called directly). See also:
// https://github.com/usethesource/rascal/commit/1ce9e59dfd7098327bbaf55a985c2a643ff52861
tuple[str, int] execWithCodeUntilSuccess() {
try {
return execWithCode(lExec, args = args);
Expand All @@ -115,31 +120,6 @@ bool doTransformTest(list[ConversionUnit] units, RepositoryStats expect, str nam
println(output);
assert false : "Actual tokenization does not match expected tokenization (see output above for details)";
}

// str result = "";
// int code = 0;
// try {
// // Presumably, this block does *exactly the same* as function
// // `execWithCode` (which was used previously). However, using that
// // function caused inexplicable errors in the presence of >7 test
// // modules. For reference:
// //
// // - Failing GitHub workflow: https://github.com/SWAT-engineering/rascal-textmate/actions/runs/10883111847/job/30195540047
// // - Code of `execWithCode`: https://github.com/usethesource/rascal/blob/5bba6e40b9d3b9af560cf3482c346bed650a1854/src/org/rascalmpl/library/util/ShellExec.rsc#L67-L75
// pid = createProcess(lExec, args = args);
// println("[LOG] Running <lExec> (args: <args>; pid: <pid>)");
// result = readEntireStream(pid);
// code = exitCode(pid);
// killProcess(pid);
// } catch e: {
// println("[ERROR] Unexpected error: <e>");
// return false;
// }

// if (code != 0) {
// println(result);
// assert false : "Actual tokenization does not match expected tokenization (see output above for details)";
// }
}

return true;
Expand Down

0 comments on commit 53fe327

Please sign in to comment.