diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/OutputLineSplitter.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/OutputLineSplitter.java index 8e5e141d37cc..a4a638b96ceb 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/OutputLineSplitter.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/OutputLineSplitter.java @@ -101,7 +101,8 @@ public abstract class OutputLineSplitter { // we can safely flush buffer. // TODO if editable: - if (myStdinSupportEnabled && !isMostLikelyServiceMessagePart(text)) { + if (myStdinSupportEnabled && !isInTeamcityMessage()) { + // We should not flush in the middle of TC message because of [PY-7659] flushStdOutBuffer(); } } @@ -150,8 +151,11 @@ public abstract class OutputLineSplitter { } } - protected boolean isMostLikelyServiceMessagePart(@NotNull final String text) { - return text.startsWith(TEAMCITY_SERVICE_MESSAGE_PREFIX); + /** + * @return if current stdout cache contains part of TC message. + */ + protected boolean isInTeamcityMessage() { + return myStdOutChunks.stream().anyMatch(chunk -> chunk.getText().startsWith(TEAMCITY_SERVICE_MESSAGE_PREFIX)); } protected abstract void onLineAvailable(@NotNull String text, @NotNull Key outputType, boolean tcLikeFakeOutput); diff --git a/python/src/com/jetbrains/python/testing/PythonTRunnerConsoleProperties.java b/python/src/com/jetbrains/python/testing/PythonTRunnerConsoleProperties.java index 31dded76fce7..46eb2fc28511 100644 --- a/python/src/com/jetbrains/python/testing/PythonTRunnerConsoleProperties.java +++ b/python/src/com/jetbrains/python/testing/PythonTRunnerConsoleProperties.java @@ -33,6 +33,9 @@ public class PythonTRunnerConsoleProperties extends SMTRunnerConsoleProperties { private final boolean myIsEditable; + /** + * @param editable if user should have ability to print something to test stdin + */ public PythonTRunnerConsoleProperties(@NotNull ModuleRunConfiguration config, @NotNull Executor executor, boolean editable) { super(config, FRAMEWORK_NAME, executor); myIsEditable = editable;