Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(threads): Use remapped thread state in thread tags #48660

Merged
merged 1 commit into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions static/app/components/events/interfaces/threads.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ describe('Threads', function () {

expect(screen.getByText('Threads')).toBeInTheDocument();
expect(screen.getByText('Thread State')).toBeInTheDocument();
expect(screen.getByText('Blocked')).toBeInTheDocument();
expect(screen.getAllByText('Blocked')).toHaveLength(2);
expect(screen.getAllByText('waiting on tid=1')).toHaveLength(2);
expect(screen.getByText('Thread Tags')).toBeInTheDocument();

Expand Down Expand Up @@ -988,7 +988,7 @@ describe('Threads', function () {
id: 0,
current: false,
crashed: true,
name: null,
name: 'main',
stacktrace: {
frames: [
{
Expand Down Expand Up @@ -1039,8 +1039,9 @@ describe('Threads', function () {

expect(screen.getByText('Threads')).toBeInTheDocument();
expect(screen.getByText('Thread State')).toBeInTheDocument();
// WaitingPerformingGc maps to Waiting
expect(screen.getByText('Waiting')).toBeInTheDocument();
// WaitingPerformingGc maps to Waiting for both Thread tag and Thread State
expect(screen.getByText('Thread Tags')).toBeInTheDocument();
expect(screen.getAllByText('Waiting')).toHaveLength(2);
});

it('toggle full stack trace button', async function () {
Expand Down
6 changes: 5 additions & 1 deletion static/app/components/events/interfaces/threads.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ export function Threads({
return null;
}

const threadStateDisplay = getMappedThreadState(threadState);

return (
<Pills>
{!isNil(id) && <Pill name={t('id')} value={String(id)} />}
Expand All @@ -167,7 +169,9 @@ export function Threads({
{crashed ? t('yes') : t('no')}
</Pill>
)}
{!isNil(threadState) && <Pill name={t('state')} value={threadState} />}
{!isNil(threadStateDisplay) && (
<Pill name={t('state')} value={threadStateDisplay} />
)}
{!isNil(lockReason) && <Pill name={t('lock reason')} value={lockReason} />}
</Pills>
);
Expand Down