Skip to content

Commit

Permalink
fix(threads): Use remapped thread state in thread tags (#48660)
Browse files Browse the repository at this point in the history
  • Loading branch information
romtsn authored May 8, 2023
1 parent df37683 commit daad433
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
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

0 comments on commit daad433

Please sign in to comment.