88 getIsolationScope ,
99 getTraceData ,
1010 SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON ,
11- SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE ,
1211 SentryNonRecordingSpan ,
1312 SentrySpan ,
1413 setCurrentClient ,
@@ -23,7 +22,7 @@ import type { Event } from '../../../src/types/event';
2322import type { Span } from '../../../src/types/span' ;
2423import { getDefaultTestClientOptions , TestClient } from '../../mocks/client' ;
2524import { resetGlobals } from '../../testutils' ;
26- import { SENTRY_SEGMENT_NAME_SOURCE } from '@sentry/conventions/attributes' ;
25+ import { SENTRY_SEGMENT_NAME_SOURCE , SENTRY_STATUS_MESSAGE } from '@sentry/conventions/attributes' ;
2726
2827const dsn = 'https://123@sentry.io/42' ;
2928
@@ -677,23 +676,17 @@ describe('startIdleSpan', () => {
677676 // Start any span to cancel idle timeout
678677 startInactiveSpan ( { name : 'span' } ) ;
679678
680- expect ( spanToJSON ( idleSpan ) . attributes [ SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE ] ) . not . toEqual (
681- 'deadline_exceeded' ,
682- ) ;
679+ expect ( spanToJSON ( idleSpan ) . attributes [ SENTRY_STATUS_MESSAGE ] ) . not . toEqual ( 'deadline_exceeded' ) ;
683680 expect ( spanToJSON ( idleSpan ) . end_timestamp ) . toBeUndefined ( ) ;
684681
685682 // Wait some time
686683 vi . advanceTimersByTime ( TRACING_DEFAULTS . childSpanTimeout - 1000 ) ;
687- expect ( spanToJSON ( idleSpan ) . attributes [ SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE ] ) . not . toEqual (
688- 'deadline_exceeded' ,
689- ) ;
684+ expect ( spanToJSON ( idleSpan ) . attributes [ SENTRY_STATUS_MESSAGE ] ) . not . toEqual ( 'deadline_exceeded' ) ;
690685 expect ( spanToJSON ( idleSpan ) . end_timestamp ) . toBeUndefined ( ) ;
691686
692687 // Wait for timeout to exceed
693688 vi . advanceTimersByTime ( 1000 ) ;
694- expect ( spanToJSON ( idleSpan ) . attributes [ SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE ] ) . not . toEqual (
695- 'deadline_exceeded' ,
696- ) ;
689+ expect ( spanToJSON ( idleSpan ) . attributes [ SENTRY_STATUS_MESSAGE ] ) . not . toEqual ( 'deadline_exceeded' ) ;
697690 expect ( spanToJSON ( idleSpan ) . end_timestamp ) . toBeDefined ( ) ;
698691 } ) ;
699692
@@ -704,41 +697,31 @@ describe('startIdleSpan', () => {
704697 // Start any span to cancel idle timeout
705698 startInactiveSpan ( { name : 'span' } ) ;
706699
707- expect ( spanToJSON ( idleSpan ) . attributes [ SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE ] ) . not . toEqual (
708- 'deadline_exceeded' ,
709- ) ;
700+ expect ( spanToJSON ( idleSpan ) . attributes [ SENTRY_STATUS_MESSAGE ] ) . not . toEqual ( 'deadline_exceeded' ) ;
710701 expect ( spanToJSON ( idleSpan ) . end_timestamp ) . toBeUndefined ( ) ;
711702
712703 // Wait some time
713704 vi . advanceTimersByTime ( TRACING_DEFAULTS . childSpanTimeout - 1000 ) ;
714- expect ( spanToJSON ( idleSpan ) . attributes [ SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE ] ) . not . toEqual (
715- 'deadline_exceeded' ,
716- ) ;
705+ expect ( spanToJSON ( idleSpan ) . attributes [ SENTRY_STATUS_MESSAGE ] ) . not . toEqual ( 'deadline_exceeded' ) ;
717706 expect ( spanToJSON ( idleSpan ) . end_timestamp ) . toBeUndefined ( ) ;
718707
719708 // New span resets the timeout
720709 startInactiveSpan ( { name : 'span' } ) ;
721710
722711 vi . advanceTimersByTime ( TRACING_DEFAULTS . childSpanTimeout - 1000 ) ;
723- expect ( spanToJSON ( idleSpan ) . attributes [ SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE ] ) . not . toEqual (
724- 'deadline_exceeded' ,
725- ) ;
712+ expect ( spanToJSON ( idleSpan ) . attributes [ SENTRY_STATUS_MESSAGE ] ) . not . toEqual ( 'deadline_exceeded' ) ;
726713 expect ( spanToJSON ( idleSpan ) . end_timestamp ) . toBeUndefined ( ) ;
727714
728715 // New span resets the timeout
729716 startInactiveSpan ( { name : 'span' } ) ;
730717
731718 vi . advanceTimersByTime ( TRACING_DEFAULTS . childSpanTimeout - 1000 ) ;
732- expect ( spanToJSON ( idleSpan ) . attributes [ SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE ] ) . not . toEqual (
733- 'deadline_exceeded' ,
734- ) ;
719+ expect ( spanToJSON ( idleSpan ) . attributes [ SENTRY_STATUS_MESSAGE ] ) . not . toEqual ( 'deadline_exceeded' ) ;
735720 expect ( spanToJSON ( idleSpan ) . end_timestamp ) . toBeUndefined ( ) ;
736721
737722 // Wait for timeout to exceed
738723 vi . advanceTimersByTime ( 1000 ) ;
739- expect ( spanToJSON ( idleSpan ) . attributes [ SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE ] ) . not . toEqual (
740- 'deadline_exceeded' ,
741- ) ;
724+ expect ( spanToJSON ( idleSpan ) . attributes [ SENTRY_STATUS_MESSAGE ] ) . not . toEqual ( 'deadline_exceeded' ) ;
742725 expect ( spanToJSON ( idleSpan ) . end_timestamp ) . toBeDefined ( ) ;
743726 } ) ;
744727
@@ -751,9 +734,7 @@ describe('startIdleSpan', () => {
751734
752735 // Wait some time
753736 vi . advanceTimersByTime ( TRACING_DEFAULTS . childSpanTimeout - 1000 ) ;
754- expect ( spanToJSON ( idleSpan ) . attributes [ SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE ] ) . not . toEqual (
755- 'deadline_exceeded' ,
756- ) ;
737+ expect ( spanToJSON ( idleSpan ) . attributes [ SENTRY_STATUS_MESSAGE ] ) . not . toEqual ( 'deadline_exceeded' ) ;
757738 expect ( spanToJSON ( idleSpan ) . end_timestamp ) . toBeUndefined ( ) ;
758739
759740 // new standalone span should not reset the timeout
@@ -762,9 +743,7 @@ describe('startIdleSpan', () => {
762743
763744 // Wait for timeout to exceed
764745 vi . advanceTimersByTime ( 1001 ) ;
765- expect ( spanToJSON ( idleSpan ) . attributes [ SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE ] ) . not . toEqual (
766- 'deadline_exceeded' ,
767- ) ;
746+ expect ( spanToJSON ( idleSpan ) . attributes [ SENTRY_STATUS_MESSAGE ] ) . not . toEqual ( 'deadline_exceeded' ) ;
768747 expect ( spanToJSON ( idleSpan ) . end_timestamp ) . toBeDefined ( ) ;
769748 } ) ;
770749 } ) ;
0 commit comments