-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Release backlog memory when features are blocked by RUM (#1102)
Co-authored-by: Patrick Housley <patrickhousley@users.noreply.github.com>
- Loading branch information
1 parent
5022134
commit 5eb9164
Showing
8 changed files
with
69 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { testRumRequest } from '../../tools/testing-server/utils/expect-tests' | ||
|
||
describe('Memory leaks', () => { | ||
it('does not occur on ee backlog when RUM flags are 0', async () => { | ||
await browser.testHandle.scheduleReply('bamServer', { | ||
test: testRumRequest, | ||
body: JSON.stringify({ st: 0, sr: 0, err: 0, ins: 0, spa: 0, loaded: 1 }) | ||
}) | ||
// This test relies on features to call deregisterDrain when not enabled by flags which in turn should clear their backlogs. | ||
|
||
await browser.url(await browser.testHandle.assetURL('obfuscate-pii.html')).then(() => browser.waitForAgentLoad()) | ||
const backlog = await browser.execute(function () { | ||
const backlog = {} | ||
for (const key in newrelic.ee.backlog) { | ||
const array = newrelic.ee.backlog[key] | ||
backlog[key] = array === null ? 0 : array.length | ||
} | ||
return backlog | ||
}) | ||
|
||
expect(backlog).toEqual(expect.objectContaining({ | ||
ajax: 0, // ajax does not rely on any flags anyways so it's always drained | ||
jserrors: 0, | ||
metrics: 0, | ||
page_action: 0, | ||
page_view_event: 0, // no handler | ||
page_view_timing: 0, // does not rely on any flags | ||
session_trace: 0, | ||
spa: 0 | ||
})) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ async function disqualifySR () { | |
sts: 1, | ||
err: 1, | ||
ins: 1, | ||
cap: 1, | ||
spa: 1, | ||
loaded: 1, | ||
sr: 0, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters