Skip to content

Automate browser based workflows with AI

Restore SKY-12240 failure-scope FE changes reverted by #13707 (#7611)

Aaron Perez473fb0ea5740
diff --git a/skyvern-frontend/src/routes/workflows/studio/runview/RunView.test.tsx b/skyvern-frontend/src/routes/workflows/studio/runview/RunView.test.tsx
index 67ddbfc9d..5e60c427e 100644
--- a/skyvern-frontend/src/routes/workflows/studio/runview/RunView.test.tsx
+++ b/skyvern-frontend/src/routes/workflows/studio/runview/RunView.test.tsx
@@ -555,6 +555,24 @@ describe("RunView failure banner", () => {
expect(scope.queryByText("canceled by user")).toBeNull();
});
+
+ test("hides the run failure banner outside the Timeline view", () => {
+ seedCompletedRun({
+ status: Status.Failed,
+ failure_reason: "Login page rejected the credentials",
+ });
+ const { container } = renderRunView();
+ const scope = within(container);
+
+ // Visible on the default Timeline view.
+ expect(
+ scope.getByText("Login page rejected the credentials"),
+ ).not.toBeNull();
+
+ // Switching to another tab hides the run-level failure banner.
+ fireEvent.click(scope.getByRole("button", { name: "Outputs" }));
+ expect(scope.queryByText("Login page rejected the credentials")).toBeNull();
+ });
});
describe("RunView live affordances", () => {
diff --git a/skyvern-frontend/src/routes/workflows/studio/runview/RunView.tsx b/skyvern-frontend/src/routes/workflows/studio/runview/RunView.tsx
index 65c849742..20c7ac2e0 100644
--- a/skyvern-frontend/src/routes/workflows/studio/runview/RunView.tsx
+++ b/skyvern-frontend/src/routes/workflows/studio/runview/RunView.tsx
@@ -352,7 +352,7 @@ export function RunView({
</div>
) : null}
- {failed && !failureDismissed ? (
+ {failed && !failureDismissed && view === "timeline" ? (
<div className="shrink-0 rounded-lg border border-destructive/40 bg-slate-elevation1 p-4">
<div className="flex items-start gap-2 text-sm font-semibold text-foreground">
<ExclamationTriangleIcon className="mt-0.5 h-4 w-4 shrink-0 text-destructive" />
diff --git a/skyvern-frontend/src/routes/workflows/workflowRun/WorkflowRunBlockDetail.test.tsx b/skyvern-frontend/src/routes/workflows/workflowRun/WorkflowRunBlockDetail.test.tsx
index 3316c7de7..bbec4d762 100644
--- a/skyvern-frontend/src/routes/workflows/workflowRun/WorkflowRunBlockDetail.test.tsx
+++ b/skyvern-frontend/src/routes/workflows/workflowRun/WorkflowRunBlockDetail.test.tsx
@@ -150,16 +150,43 @@ describe("WorkflowRunBlockDetail router", () => {
expect(screen.queryByText("Pull the price from the page")).toBeNull();
});
- it("renders the failure_reason in the detail body (not the header) when set", () => {
+ it("shows the failure_reason once, scoped to the Summary sub-panel", () => {
const block = buildBlock({
block_type: "extraction",
failure_reason: "Could not locate the price element",
});
render(<WorkflowRunBlockDetail activeItem={block} timeline={[]} />);
+ // A failed block opens on Summary and shows the failure exactly once — no
+ // longer duplicated between the Summary field and a persistent callout.
expect(screen.getByText("Failure")).toBeDefined();
expect(
- screen.getAllByText("Could not locate the price element").length,
- ).toBeGreaterThanOrEqual(1);
+ screen.getAllByText("Could not locate the price element"),
+ ).toHaveLength(1);
+ // Switching sub-panels no longer repeats the failure.
+ fireEvent.mouseDown(screen.getByRole("tab", { name: "Inputs" }));
+ expect(screen.queryByText("Could not locate the price element")).toBeNull();
+ });
+
+ it("shows a triggered-workflow failure once, not in a separate body section", () => {
+ // The backend copies the child failure into both block.failure_reason and
+ // block.output.failure_reason, so the Summary callout already covers it.
+ const reason = "Triggered workflow execution failed: boom";
+ const block = buildBlock({
+ block_type: "workflow_trigger",
+ failure_reason: reason,
+ output: {
+ workflow_run_id: "wr_child",
+ status: "failed",
+ failure_reason: reason,
+ },
+ });
+ render(
+ <MemoryRouter>
+ <WorkflowRunBlockDetail activeItem={block} timeline={[]} />
+ </MemoryRouter>,
+ );
+ expect(screen.getAllByText(reason)).toHaveLength(1);
+ expect(screen.queryByText("Sub-workflow failure")).toBeNull();
});
it("renders code block extracted information without the raw output wrapper", () => {
diff --git a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailConditional.tsx b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailConditional.tsx
index 1417c0ebc..c493b5026 100644
--- a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailConditional.tsx
+++ b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailConditional.tsx
@@ -3,7 +3,7 @@ import {
type WorkflowRunBlock,
} from "../../types/workflowRunTypes";
import { JsonExplorer } from "./BlockInspector";
-import { BlockDetailFailure, CodeBlock, Section } from "./shared";
+import { CodeBlock, Section } from "./shared";
import { cn } from "@/util/utils";
type Props = {
@@ -44,7 +44,6 @@ function BlockDetailConditional({ block }: Props) {
return (
<div className="space-y-4 px-3 py-3 empty:hidden">
- <BlockDetailFailure block={block} />
{hasExecutedBranch && evaluations && evaluations.length > 0 ? (
<Section title="Branches">
<div className="space-y-2">
diff --git a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailGeneric.tsx b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailGeneric.tsx
index 35cbc1d6c..2f3ad65c4 100644
--- a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailGeneric.tsx
+++ b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailGeneric.tsx
@@ -1,5 +1,5 @@
import type { WorkflowRunBlock } from "../../types/workflowRunTypes";
-import { BlockDetailFailure, GoalText, Section } from "./shared";
+import { GoalText, Section } from "./shared";
type Props = {
block: WorkflowRunBlock;
@@ -8,7 +8,6 @@ type Props = {
function BlockDetailGeneric({ block }: Props) {
return (
<div className="space-y-4 px-3 py-3 empty:hidden">
- <BlockDetailFailure block={block} />
{block.prompt && (
<Section title="Prompt">
<GoalText text={block.prompt} />
diff --git a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailHttpRequest.tsx b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailHttpRequest.tsx
index 0c4faff38..6189fb224 100644
--- a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailHttpRequest.tsx
+++ b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailHttpRequest.tsx
@@ -1,6 +1,6 @@
import type { WorkflowRunBlock } from "../../types/workflowRunTypes";
import { JsonExplorer } from "./BlockInspector";
-import { BlockDetailFailure, Section } from "./shared";
+import { Section } from "./shared";
type Props = {
block: WorkflowRunBlock;
@@ -9,7 +9,6 @@ type Props = {
function BlockDetailHttpRequest({ block }: Props) {
return (
<div className="space-y-4 px-3 py-3 empty:hidden">
- <BlockDetailFailure block={block} />
{block.url && (
<Section title="URL">
<span className="break-all text-xs text-tertiary-foreground">
diff --git a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailHumanInteraction.tsx b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailHumanInteraction.tsx
index d6fbc58ca..ee0a9cabd 100644
--- a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailHumanInteraction.tsx
+++ b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailHumanInteraction.tsx
@@ -1,6 +1,6 @@
import type { WorkflowRunBlock } from "../../types/workflowRunTypes";
import { WorkflowRunHumanInteraction } from "../WorkflowRunHumanInteraction";
-import { BlockDetailFailure, GoalText, Section } from "./shared";
+import { GoalText, Section } from "./shared";
type Props = {
block: WorkflowRunBlock;
@@ -10,7 +10,6 @@ function BlockDetailHumanInteraction({ block }: Props) {
const recipients = block.recipients ?? [];
return (
<div className="space-y-4 px-3 py-3 empty:hidden">
- <BlockDetailFailure block={block} />
{block.instructions && (
<Section title="Instructions">
<GoalText text={block.instructions} />
diff --git a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailLoop.tsx b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailLoop.tsx
index 614937fad..08a6a0241 100644
--- a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailLoop.tsx
+++ b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailLoop.tsx
@@ -1,6 +1,6 @@
import type { WorkflowRunBlock } from "../../types/workflowRunTypes";
import { stringifyTimelineValue } from "./formatValue";
-import { BlockDetailFailure, CodeBlock, Section } from "./shared";
+import { CodeBlock, Section } from "./shared";
type Props = {
block: WorkflowRunBlock;
@@ -29,7 +29,6 @@ function BlockDetailLoop({ block, iterationIndex = null }: Props) {
return (
<div className="space-y-4 px-3 py-3 empty:hidden">
- <BlockDetailFailure block={block} />
{showIterationOnly && (
<Section title={`Iteration ${(highlightIndex ?? 0) + 1} value`}>
<CodeBlock>{stringifyTimelineValue(highlightedValue)}</CodeBlock>
diff --git a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailTask.tsx b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailTask.tsx
index e98fc6230..cd659b2c1 100644
--- a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailTask.tsx
+++ b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailTask.tsx
@@ -3,7 +3,7 @@ import type {
WorkflowRunBlock,
} from "../../types/workflowRunTypes";
import type { WorkflowRunOverviewActiveElement } from "../WorkflowRunOverview";
-import { BlockDetailFailure, BlockThoughtList } from "./shared";
+import { BlockThoughtList } from "./shared";
type Props = {
block: WorkflowRunBlock;
@@ -13,14 +13,12 @@ type Props = {
};
function BlockDetailTask({
- block,
activeItem,
thoughts = [],
onThoughtSelect,
}: Props) {
return (
<div className="space-y-4 px-3 py-3 empty:hidden">
- <BlockDetailFailure block={block} />
<BlockThoughtList
thoughts={thoughts}
activeItem={activeItem}
diff --git a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailWorkflowTrigger.tsx b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailWorkflowTrigger.tsx
index 2b72947fb..f0caf9674 100644
--- a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailWorkflowTrigger.tsx
+++ b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockDetailWorkflowTrigger.tsx
@@ -1,6 +1,6 @@
import { Link } from "react-router-dom";
import type { WorkflowRunBlock } from "../../types/workflowRunTypes";
-import { BlockDetailFailure, JsonView, Section } from "./shared";
+import { JsonView, Section } from "./shared";
type Props = {
block: WorkflowRunBlock;
@@ -10,7 +10,6 @@ type SubWorkflowRun = {
workflow_run_id?: string;
workflow_permanent_id?: string;
status?: string;
- failure_reason?: string | null;
outputs?: unknown;
};
@@ -35,7 +34,6 @@ function BlockDetailWorkflowTrigger({ block }: Props) {
return (
<div className="space-y-4 px-3 py-3 empty:hidden">
- <BlockDetailFailure block={block} />
{subRun?.workflow_run_id && (
<Section title="Triggered run">
<div className="flex flex-wrap items-center gap-2 text-xs">
@@ -56,13 +54,6 @@ function BlockDetailWorkflowTrigger({ block }: Props) {
</div>
</Section>
)}
- {subRun?.failure_reason && (
- <Section title="Sub-workflow failure">
- <div className="rounded border border-destructive/40 bg-destructive/10 px-2.5 py-2 text-xs leading-relaxed text-destructive">
- {subRun.failure_reason}
- </div>
- </Section>
- )}
{hasSubRunOutput && (
<Section title="Sub-workflow output">
<JsonView value={subRun!.outputs} />
diff --git a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockInspector.test.tsx b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockInspector.test.tsx
index 5ea7f9ca5..9c5914885 100644
--- a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockInspector.test.tsx
+++ b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockInspector.test.tsx
@@ -150,3 +150,37 @@ describe("BlockInspector Inputs tab", () => {
expect(screen.getByText("Fill out the form")).toBeDefined();
});
});
+
+describe("BlockInspector failure scoping", () => {
+ it("shows the failure reason on Summary and not on the other sub-panels", () => {
+ const block = buildBlock({
+ failure_reason: "Element not found",
+ });
+ render(<BlockInspector block={block} />);
+
+ expect(screen.getByText("Failure")).toBeDefined();
+ expect(screen.getByText("Element not found")).toBeDefined();
+
+ fireEvent.mouseDown(screen.getByRole("tab", { name: "Inputs" }));
+ expect(screen.queryByText("Element not found")).toBeNull();
+ });
+
+ it("opens on Summary for a failed block even when output exists", () => {
+ const block = buildBlock({
+ failure_reason: "Element not found",
+ output: { result: "partial" },
+ });
+ render(<BlockInspector block={block} />);
+
+ // Default tab is Summary (not Outputs), so the failure is visible on load.
+ expect(screen.getByText("Element not found")).toBeDefined();
+ });
+
+ it("surfaces the block failure on Summary when an action is selected", () => {
+ const block = buildBlock({ failure_reason: "Login rejected" });
+ const action = buildAction({ action_type: ActionTypes.Click });
+ render(<BlockInspector block={block} action={action} />);
+
+ expect(screen.getByText("Login rejected")).toBeDefined();
+ });
+});
diff --git a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockInspector.tsx b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockInspector.tsx
index 032a38209..2f99cc38f 100644
--- a/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockInspector.tsx
+++ b/skyvern-frontend/src/routes/workflows/workflowRun/blockDetail/BlockInspector.tsx
@@ -19,6 +19,7 @@ import {
shouldShowExtractedInformation,
type WorkflowRunBlock,
} from "../../types/workflowRunTypes";
+import { BlockDetailFailure } from "./shared";
type InspectorField = {
label: string;
@@ -380,7 +381,6 @@ function getSummaryFields(block: WorkflowRunBlock): Array<InspectorField> {
const fields: Array<InspectorField> = [];
pushField(fields, "Task ID", block.task_id);
pushField(fields, "Engine", block.engine);
- pushField(fields, "Failure reason", block.failure_reason);
pushField(fields, "Executed branch", block.executed_branch_expression);
pushField(fields, "Executed branch result", block.executed_branch_result);
pushField(fields, "Executed next block", block.executed_branch_next_block);
@@ -543,7 +543,13 @@ function BlockInspector({
const outputTabLabel = showsExtractedInformation
? "Extracted Information"
: "Outputs";
- const defaultTab = hasOutput ? "outputs" : "summary";
+ // A failed block/action opens on Summary so its failure reason (the only
+ // place it now renders) is visible without hunting through tabs.
+ const defaultTab = block.failure_reason
+ ? "summary"
+ : hasOutput
+ ? "outputs"
+ : "summary";
const [activeTab, setActiveTab] = useState(defaultTab);
const diagnosticsTaskId = action?.task_id ?? block.task_id;
const diagnosticsStepIndex = action
@@ -599,7 +605,8 @@ function BlockInspector({
</Link>
)}
</TabsList>
- <TabsContent value="summary" className="m-0">
+ <TabsContent value="summary" className="m-0 space-y-3">
+ <BlockDetailFailure block={block} />
<FieldList
fields={summaryFields}
emptyText="No additional summary data."
diff --git a/skyvern/forge/sdk/forge_log.py b/skyvern/forge/sdk/forge_log.py
index 7a31d0542..e2e5c8030 100644
--- a/skyvern/forge/sdk/forge_log.py
+++ b/skyvern/forge/sdk/forge_log.py
@@ -31,25 +31,38 @@ _entrypoint: str = "unknown"
_DRIVER_PIPE_CLOSED_ERROR = "Connection closed while reading from the driver"
_TARGET_CLOSED_ERROR = "Target page, context or browser has been closed"
_ORPHANED_FUTURE_MESSAGE = "Future exception was never retrieved"
+_ORPHANED_TASK_MESSAGE = "Task exception was never retrieved"
_TARGET_CLOSED_ERROR_TYPE = "TargetClosedError"
+_CHANNEL_COLLECTED_ERROR = "The object has been collected to prevent unbounded heap growth"
class _DriverPipeNoiseFilter(logging.Filter):
- """Drop asyncio's orphaned-future noise from a torn-down Playwright driver/target.
-
- Benign teardown race: a fire-and-forget driver op left a future behind, then the
- target closed before it resolved, so asyncio logs the un-retrieved exception at
- ERROR. Two variants are suppressed: the driver-pipe close (matched by its
- distinctive message) and patchright's TargetClosedError. The latter is matched by
- exception *type*, not text — the same "...has been closed" message can also come
- from a crashed/killed browser, so a type check keeps real failures visible.
+ """Drop asyncio's orphaned-task/future noise from a torn-down Playwright driver/target.
+
+ All variants are the same benign artifact: a fire-and-forget driver coroutine left a
+ task/future behind, then the target/driver went away before it resolved, so asyncio's
+ __del__ logs the un-retrieved exception at ERROR. Suppressed cases:
+ - driver-pipe close (matched by its distinctive message);
+ - patchright's TargetClosedError, matched by exception *type* not text — the same
+ "...has been closed" message can also come from a crashed/killed browser, so a
+ type check keeps real failures visible (Future variant only, unchanged);
+ - Playwright's "Channel.send: The object has been collected ..." teardown, matched by
+ its distinctive message on either the Task or Future orphaned-artifact variant.
+ This is a recurring, high-volume, pre-existing teardown pattern; it is unrelated to
+ OTEL instrumentation (asyncio's __del__ emits it whether or not AsyncioInstrumentor
+ is loaded — the instrumentor only adds a trace_coroutine frame to the traceback).
"""
def filter(self, record: logging.LogRecord) -> bool:
message = record.getMessage()
+ exc = record.exc_info[1] if record.exc_info and len(record.exc_info) > 1 else None
+ is_orphaned = _ORPHANED_FUTURE_MESSAGE in message or _ORPHANED_TASK_MESSAGE in message
+ if is_orphaned and (
+ _CHANNEL_COLLECTED_ERROR in message or (exc is not None and _CHANNEL_COLLECTED_ERROR in str(exc))
+ ):
+ return False
if _ORPHANED_FUTURE_MESSAGE not in message:
return True
- exc = record.exc_info[1] if record.exc_info and len(record.exc_info) > 1 else None
if _DRIVER_PIPE_CLOSED_ERROR in message or (exc is not None and _DRIVER_PIPE_CLOSED_ERROR in str(exc)):
return False
if exc is not None:
diff --git a/tests/unit/test_forge_log_driver_pipe_noise.py b/tests/unit/test_forge_log_driver_pipe_noise.py
index a104965e1..220f66280 100644
--- a/tests/unit/test_forge_log_driver_pipe_noise.py
+++ b/tests/unit/test_forge_log_driver_pipe_noise.py
@@ -12,6 +12,30 @@ class TargetClosedError(Exception):
"""Stand-in for patchright's TargetClosedError (the filter matches by type name)."""
+class PlaywrightError(Exception):
+ """Stand-in for playwright/patchright's Error carrying the collected-object message."""
+
+
+_CHANNEL_COLLECTED_TEXT = "Channel.send: The object has been collected to prevent unbounded heap growth."
+
+
+def _orphaned_task_record_for(
+ exc: Exception, *, message: str = "Task exception was never retrieved", include_repr: bool = True
+) -> logging.LogRecord:
+ msg = message
+ if include_repr:
+ msg = f"{message}\ntask: <Task finished name='Task-1' coro=<foo() done> exception={exc!r}>"
+ return logging.LogRecord(
+ name="asyncio",
+ level=logging.ERROR,
+ pathname=__file__,
+ lineno=1,
+ msg=msg,
+ args=(),
+ exc_info=(type(exc), exc, None),
+ )
+
+
def _orphaned_future_record(exc_text: str) -> logging.LogRecord:
return _orphaned_future_record_for(Exception(exc_text))
@@ -103,6 +127,36 @@ def test_filter_keeps_target_closed_error_from_awaited_path() -> None:
assert _DriverPipeNoiseFilter().filter(record) is True
+def test_filter_drops_collected_object_task_noise() -> None:
+ # The recurring Hetzner burst: an orphaned Playwright teardown coroutine raises
+ # "Channel.send: The object has been collected ..." and asyncio logs it as a
+ # "Task exception was never retrieved" record. Pre-existing benign teardown noise.
+ record = _orphaned_task_record_for(PlaywrightError(_CHANNEL_COLLECTED_TEXT))
+ assert _DriverPipeNoiseFilter().filter(record) is False
+
+
+def test_filter_drops_collected_object_future_noise() -> None:
+ # Same collected-object teardown surfacing on the Future variant.
+ record = _orphaned_future_record_for(PlaywrightError(_CHANNEL_COLLECTED_TEXT))
+ assert _DriverPipeNoiseFilter().filter(record) is False
+
+
+def test_filter_drops_collected_object_via_exc_info_when_message_lacks_repr() -> None:
+ record = _orphaned_task_record_for(PlaywrightError(_CHANNEL_COLLECTED_TEXT), include_repr=False)
+ assert _DriverPipeNoiseFilter().filter(record) is False
+
+
+def test_filter_keeps_execution_context_destroyed_orphaned_task() -> None:
+ # A different asyncio teardown class must stay visible — narrow suppression only.
+ record = _orphaned_task_record_for(PlaywrightError("Execution context was destroyed"))
+ assert _DriverPipeNoiseFilter().filter(record) is True
+
+
+def test_filter_keeps_generic_orphaned_task() -> None:
+ record = _orphaned_task_record_for(RuntimeError("some genuinely different bug"))
+ assert _DriverPipeNoiseFilter().filter(record) is True
+
+
def test_filter_keeps_other_orphaned_future_exceptions() -> None:
record = _orphaned_future_record("some other unrelated failure")
assert _DriverPipeNoiseFilter().filter(record) is True
@@ -164,10 +218,12 @@ def test_setup_logger_filter_suppresses_emitted_noise(_restore_asyncio_filters:
asyncio_logger.addHandler(handler)
try:
asyncio_logger.handle(_orphaned_future_record("Connection closed while reading from the driver"))
+ asyncio_logger.handle(_orphaned_task_record_for(PlaywrightError(_CHANNEL_COLLECTED_TEXT)))
asyncio_logger.handle(_orphaned_future_record("a genuinely different error"))
finally:
asyncio_logger.removeHandler(handler)
messages = [r.getMessage() for r in captured]
assert not any("Connection closed while reading from the driver" in m for m in messages)
+ assert not any(_CHANNEL_COLLECTED_TEXT in m for m in messages)
assert any("a genuinely different error" in m for m in messages)