Skip to content

test(node): Add tests for current DSC transaction name updating behavior #13961

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

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Oct 11, 2024

This PR adds tests for DSC updating behaviour in the Node SDK, analogously to #13953

Currently, also in Node, we mutate the DSC and always include the most up to date transaction name

@Lms24 Lms24 changed the base branch from develop to lms/browser-dsc-transaction-name-frozen October 11, 2024 15:45
@Lms24 Lms24 force-pushed the lms/node-dsc-transaction-name-tests branch from 75af20f to 8a67452 Compare October 11, 2024 15:48
@Lms24 Lms24 requested review from a team as code owners October 11, 2024 15:48
@Lms24 Lms24 changed the base branch from lms/browser-dsc-transaction-name-frozen to develop October 11, 2024 15:48
@Lms24 Lms24 removed request for a team October 11, 2024 15:48
Copy link
Member Author

@Lms24 Lms24 Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fought multiple hours with our test runner to get these tests working. Very frustrating.

Turns out, you can't assert on headers in the test server as well as on events in the same test. It will appear as if it's working but it won't fail if an assertion actually fails :/
moreover, there#s also super weird inter operation between expect and ecpectHeaders when you want to check on an event and its headers. After trying to make everything work in one test, I eventually gave up and made one for baggage and one for the trace envelope header.

I think part of the problem is that there is some race condition with the test server and the test runners both calling done which completely fucks up the assertion count.

@Lms24 Lms24 requested review from mydea and cleptric October 11, 2024 15:51
@Lms24 Lms24 self-assigned this Oct 11, 2024
Copy link
Contributor

github-actions bot commented Oct 11, 2024

size-limit report 📦

Path Size % Change Change
@sentry/browser 22.73 KB - -
@sentry/browser - with treeshaking flags 21.53 KB - -
@sentry/browser (incl. Tracing) 35.01 KB - -
@sentry/browser (incl. Tracing, Replay) 71.68 KB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.07 KB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 76.01 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 88.78 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback, metrics) 90.63 KB - -
@sentry/browser (incl. metrics) 27 KB - -
@sentry/browser (incl. Feedback) 39.87 KB - -
@sentry/browser (incl. sendFeedback) 27.38 KB - -
@sentry/browser (incl. FeedbackAsync) 32.17 KB - -
@sentry/react 25.49 KB - -
@sentry/react (incl. Tracing) 37.97 KB - -
@sentry/vue 26.91 KB - -
@sentry/vue (incl. Tracing) 36.9 KB - -
@sentry/svelte 22.87 KB - -
CDN Bundle 24.11 KB - -
CDN Bundle (incl. Tracing) 36.84 KB - -
CDN Bundle (incl. Tracing, Replay) 71.47 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 76.78 KB - -
CDN Bundle - uncompressed 70.7 KB - -
CDN Bundle (incl. Tracing) - uncompressed 109.36 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 221.72 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 234.94 KB - -
@sentry/nextjs (client) 37.94 KB - -
@sentry/sveltekit (client) 35.6 KB - -
@sentry/node 124.9 KB -0.01% -1 B 🔽
@sentry/node - without tracing 94.13 KB - -
@sentry/aws-serverless 103.7 KB -0.01% -1 B 🔽

View base workflow run

Copy link

codecov bot commented Oct 11, 2024

❌ 6 Tests Failed:

Tests completed Failed Passed Skipped
638 6 632 26
View the top 3 failed tests by shortest run time
tracing/trace-lifetime/pageload-meta/test.ts create a new trace for a navigation after the <meta> tag pageload trace
Stack Traces | 0.233s run time
test.ts:18:11 create a new trace for a navigation after the <meta> tag pageload trace
tracing/trace-lifetime/pageload-meta/test.ts error during <meta> tag pageload has pageload traceId
Stack Traces | 0.312s run time
test.ts:136:11 error during <meta> tag pageload has pageload traceId
tracing/trace-lifetime/pageload-meta/test.ts outgoing XHR request during <meta> tag pageload has pageload traceId in headers
Stack Traces | 0.338s run time
test.ts:247:11 outgoing XHR request during <meta> tag pageload has pageload traceId in headers

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

@Lms24 Lms24 force-pushed the lms/node-dsc-transaction-name-tests branch from 8a67452 to 08fdf0d Compare October 14, 2024 12:44
@Lms24 Lms24 requested review from a team and s1gr1d and removed request for a team October 14, 2024 13:32
Copy link
Member

@s1gr1d s1gr1d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I think it's okay to just add tests for the stuff that didn't fall into a race condition. But what a bummer that this didn't work :/

@Lms24 Lms24 merged commit 4c0c25c into develop Oct 15, 2024
123 checks passed
@Lms24 Lms24 deleted the lms/node-dsc-transaction-name-tests branch October 15, 2024 09:06
billyvg pushed a commit that referenced this pull request Oct 17, 2024
…ior (#13961)

Add tests for DSC updating behaviour in the Node SDK,
analogously to #13953
billyvg pushed a commit that referenced this pull request Oct 17, 2024
…ior (#13961)

Add tests for DSC updating behaviour in the Node SDK,
analogously to #13953
billyvg pushed a commit that referenced this pull request Oct 17, 2024
…ior (#13961)

Add tests for DSC updating behaviour in the Node SDK,
analogously to #13953
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants