Skip to content

Commit

Permalink
Add link to actor logs and message that task logs don't exist for asy…
Browse files Browse the repository at this point in the history
…nc actors (ray-project#35828)

Signed-off-by: Alan Guo <[email protected]>
  • Loading branch information
alanwguo authored May 27, 2023
1 parent 11370b6 commit 35cdd25
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import React from "react";
import { getActor } from "../../service/actor";
import { getServeApplications } from "../../service/serve";
Expand All @@ -19,7 +18,7 @@ const mockGetActor = jest.mocked(getActor);

describe("ServeApplicationsListPage", () => {
it("renders list", async () => {
expect.assertions(15);
expect.assertions(14);

// Mock ServeController actor fetch
mockGetActor.mockResolvedValue({
Expand Down Expand Up @@ -81,8 +80,6 @@ describe("ServeApplicationsListPage", () => {

render(<ServeApplicationsListPage />, { wrapper: TEST_APP_WRAPPER });

const user = userEvent.setup();

await screen.findByText("System");
expect(screen.getByText("System")).toBeVisible();
expect(screen.getByText("1.2.3.4")).toBeVisible();
Expand All @@ -106,11 +103,6 @@ describe("ServeApplicationsListPage", () => {
expect(screen.getByText("/second-app")).toBeVisible();
expect(screen.getByText("DEPLOYING")).toBeVisible();

// Config dialog
await user.click(screen.getAllByText("View")[0]);
await screen.findByText(/import_path: home:graph/);
expect(screen.getByText(/import_path: home:graph/)).toBeVisible();

expect(screen.getByText("Metrics")).toBeVisible();
});
});
28 changes: 25 additions & 3 deletions dashboard/client/src/pages/task/TaskPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,27 @@ type TaskLogsProps = {
};

const TaskLogs = ({
task: { task_id, error_message, error_type, worker_id, node_id },
task: {
task_id,
error_message,
error_type,
worker_id,
task_log_info,
actor_id,
},
}: TaskLogsProps) => {
const errorDetails =
error_type !== null && error_message !== null
? `Error Type: ${error_type}\n\n${error_message}`
: undefined;

const otherLogsLink =
task_log_info === null && actor_id !== null
? `/actors/${actor_id}`
: undefined;

const tabs: MultiTabLogViewerTabDetails[] = [
...(worker_id !== null && node_id !== null
...(worker_id !== null && task_log_info !== null
? ([
{
title: "stderr",
Expand All @@ -255,6 +267,16 @@ const TaskLogs = ({
},
] as const)
: []),
...(task_log_info === null
? [
{
title: "Logs",
contents:
"Logs of async actor tasks or threaded actor tasks (concurency > 1) are only available " +
'as part of the actor logs. Please click "Other logs" link above to access the actor logs.',
},
]
: []),
// TODO(aguo): uncomment once PID is available in the API.
// {
// title: "system",
Expand All @@ -266,5 +288,5 @@ const TaskLogs = ({
? [{ title: "Error stack trace", contents: errorDetails }]
: []),
];
return <MultiTabLogViewer tabs={tabs} />;
return <MultiTabLogViewer tabs={tabs} otherLogsLink={otherLogsLink} />;
};

0 comments on commit 35cdd25

Please sign in to comment.