-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
test(replay): Add integration tests for input masking on change #7260
Conversation
size-limit report 📦
|
ref: #7044 |
Replay SDK metrics 🚀
develop |
Revision | LCP | CLS | CPU | JS heap avg | JS heap max | netTx | netRx | netCount | netTime |
---|---|---|---|---|---|---|---|---|---|
e60cd02 | +56.25 ms | -0.00 ms | +6.32 pp | +927.44 kB | +1.06 MB | +2.21 kB | +41 B | +1 | +117.55 ms |
e25c067 | +48.34 ms | +0.00 ms | +5.59 pp | +926.37 kB | +1.05 MB | +2.22 kB | +41 B | +1 | +65.23 ms |
b1b249b | +43.88 ms | +0.00 ms | +4.80 pp | +937.99 kB | +1.05 MB | +2.22 kB | +41 B | +1 | +111.56 ms |
12e34d4 | +28.57 ms | +0.00 ms | +5.77 pp | +930.12 kB | +1.04 MB | +2.26 kB | +41 B | +1 | +109.67 ms |
c46c56c | +65.45 ms | -0.00 ms | +5.38 pp | +930.26 kB | +1.07 MB | +2.21 kB | +41 B | +1 | +91.29 ms |
7f4c4ec | +56.64 ms | -0.00 ms | +5.57 pp | +927.42 kB | +1.06 MB | +2.21 kB | +41 B | +1 | +110.83 ms |
00d2360 | +55.18 ms | +0.00 ms | +2.23 pp | +934.14 kB | +1.05 MB | +2.22 kB | +41 B | +1 | +71.65 ms |
Last updated: Thu, 23 Feb 2023 08:55:46 GMT
await page.locator('#input').type(text) | ||
const snapshots = getIncrementalRecordingSnapshots(await reqPromise1).filter(isInputMutation); | ||
const lastSnapshot = snapshots[snapshots.length-1]; | ||
expect(lastSnapshot.text).toBe(text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we be sure that this snapshot always comes last? If yes, no problem! Just asking because I observed quite some flakiness with incremental snapshots across different browsers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I observed a bunch of flake too from mouse movements I think -- having the isInputMutation
filter helps with that and those are sorted (otherwise playing back input changes would not work as expected).
ccd4bb9
to
e3edf79
Compare
a5bce54
to
3683461
Compare
'should mask input initial value and its changes', | ||
async ({ browserName, forceFlushReplay, getLocalTestPath, page }) => { | ||
// TODO(replay): This is flakey on firefox where we do not always get the latest mutation. | ||
if (shouldSkipReplayTest() || browserName === 'firefox') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @Lms24 did the same for some other test, IMHO it is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, let's skip this on FF
@billyvg we just discussed in the team that in order to avoid flaky tests, whenever we introduce new integration tests that have the potential to be flaky we want to make sure to run them 100x on CI to figure out if they are flaky before we merge. So basically, could you wrap the new test(s) like here: 53dd25a, and only when this passes, remove it again before we merge? |
b618a74
to
08967e2
Compare
@mydea Looks like webkit also flakes at ~<5% of the time -- should we skip webkit as well? |
I was just curious so I reduced the text to type out in the test to 4 characters (down from 14), webkit failed twice total -- and luckily for me these tests ended up flaking D: 2x - [firefox] › suites/tracing/browsertracing/backgroundtab-pageload/test.ts:7:11 › should finish pageload transaction when the page goes background I still think we should skip webkit, but I'll keep the reduced text |
👍 This is fine, IMHO better to skip on webkit than to flake every now and then. Let's |
FYI I will merge this in as I will open a PR moving some package folders around a bit, so merging this in first will avoid merge conflicts later. |
104e54f
to
8521f87
Compare
This adds integration tests for input masking specifically when `maskAllInputs = false`. remove unused snapshots skip firefox for these tests due to flakeyness TEMP: run 100x shorter test text Revert "TEMP: run 100x" This reverts commit 08967e2. skip webkit
run 100 times fix flaky? unrun 100
8521f87
to
ea80817
Compare
Flaked: [chromium] › suites/stacktraces/protocol_fn_identifiers/test.ts:7:11 › should parse function identifiers that are protocol names correctly |
Jup, but that's unrelated to this PR at least, so I can finally merge this xD |
This adds integration tests for input masking specifically when
maskAllInputs = false
.Requires getsentry/rrweb#61 and getsentry/rrweb#60
Closes #7257