From 53fe3273270dd272dae6b53922018c4a5ee8c159 Mon Sep 17 00:00:00 2001 From: Sung-Shik Jongmans Date: Mon, 16 Sep 2024 16:33:39 +0200 Subject: [PATCH] Add comment and remove old code related to issue with shell executions --- .../rascal/lang/textmate/ConversionTests.rsc | 30 ++++--------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/rascal-textmate-core/src/main/rascal/lang/textmate/ConversionTests.rsc b/rascal-textmate-core/src/main/rascal/lang/textmate/ConversionTests.rsc index c31bfd7..fb42733 100644 --- a/rascal-textmate-core/src/main/rascal/lang/textmate/ConversionTests.rsc +++ b/rascal-textmate-core/src/main/rascal/lang/textmate/ConversionTests.rsc @@ -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); @@ -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 (args: ; pid: )"); - // result = readEntireStream(pid); - // code = exitCode(pid); - // killProcess(pid); - // } catch e: { - // println("[ERROR] Unexpected error: "); - // return false; - // } - - // if (code != 0) { - // println(result); - // assert false : "Actual tokenization does not match expected tokenization (see output above for details)"; - // } } return true;