Skip to content
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

Testing: Add a way to simulate slow network or CPU in e2e tests #15677

Closed
gziolo opened this issue May 16, 2019 · 0 comments · Fixed by #18770
Closed

Testing: Add a way to simulate slow network or CPU in e2e tests #15677

gziolo opened this issue May 16, 2019 · 0 comments · Fixed by #18770
Assignees
Labels
Needs Dev Ready for, and needs developer efforts [Status] In Progress Tracking issues with work in progress [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Enhancement A suggestion for improvement.

Comments

@gziolo
Copy link
Member

gziolo commented May 16, 2019

Related #15538, #14986.

We constantly encounter issues with tests which fail randomly. It's more noticeable on Travis. It's usually difficult to reproduce those failures locally but it turns out that we can simulate slow network or CPU with Puppeteer API. I opened an issue argos-ci/jest-puppeteer#241 to see whether it'd be a good idea to include such debugging tools into jest-puppeteer. If it gets rejected we should integrate it into our e2e test setup ourselves.

Full proposal:
argos-ci/jest-puppeteer#241.

Example of debugging code used with other PRs in the past:

	const client = await page.target().createCDPSession();
	await client.send( 'Network.emulateNetworkConditions', {
		// Whether chrome should simulate
		// the absence of connectivity
		offline: false,
		// Simulated download speed (bytes/s)
		downloadThroughput: 1.5 * 1024 * 1024 / 8,
		// Simulated upload speed (bytes/s)
		uploadThroughput: 750 * 1024 / 8,
		// Simulated latency (ms)
		latency: 40,
	} );
	await client.send( 'Emulation.setCPUThrottlingRate', { rate: 4 } );
@gziolo gziolo added [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Enhancement A suggestion for improvement. labels May 16, 2019
@gziolo gziolo added the Needs Dev Ready for, and needs developer efforts label Nov 4, 2019
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Dev Ready for, and needs developer efforts [Status] In Progress Tracking issues with work in progress [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants