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

Test Settings Sync request threshold #141287

Closed
2 tasks done
sandy081 opened this issue Jan 24, 2022 · 0 comments
Closed
2 tasks done

Test Settings Sync request threshold #141287

sandy081 opened this issue Jan 24, 2022 · 0 comments

Comments

@sandy081
Copy link
Member

sandy081 commented Jan 24, 2022

Refs: #91286

Complexity: 4

Create Issue


Test Threshold

Each Settings Sync activity is debounced for 2 seconds and queued until the current sync is finished.

  • Turn on Settings Sync on VS Code Desktop
  • Open Log: Settings Sync output channel
  • Open settings UI editor
  • Clear the settings sync logs
  • From settings editor, continuously keep changing a setting (eg, color theme)

Test that sync activities are debounced and throttled - you can check that from Settings Sync log. For eg: following log represents one single settings sync activity:

[2022-01-24 15:54:14.760] [settingssync] [info] Auto Sync: Triggered by Activity
[2022-01-24 15:54:14.839] [settingssync] [info] Settings: No changes found during synchronizing settings.
[2022-01-24 15:54:14.846] [settingssync] [info] Keybindings: No changes found during synchronizing keybindings.
[2022-01-24 15:54:14.850] [settingssync] [info] Snippets: No changes found during synchronizing snippets.
[2022-01-24 15:54:14.853] [settingssync] [info] Tasks: No changes found during synchronizing tasks.
[2022-01-24 15:54:14.859] [settingssync] [info] GlobalState: No changes found during synchronizing ui state.
[2022-01-24 15:54:14.960] [settingssync] [info] Extensions: No changes found during synchronizing extensions.
[2022-01-24 15:54:14.961] [settingssync] [info] Sync done. Took 136ms

Test exceeding the client side rate limit

Write a sample extension that keeps changing a setting in a loop for 50 times:

vscode.commands.registerCommand('testExtension.testSync', async () => {
		for (let i = 0; i < 50; i++) {
			await vscode.workspace.getConfiguration().update('workbench.sideBar.location', vscode.workspace.getConfiguration().get('workbench.sideBar.location') === 'left' ? 'right' : 'left', true);
			console.log(i);
			await new Promise((c, e) => setTimeout(c, 2500));
		}
	});

Turn on Settings Sync and run above extension+command. This causes client to exceed rate limit and when it happens, a dialog is shown that settings sync is suspended until restarting VS Code. Restarting VS Code shall resume the settings sync.

@sandy081 sandy081 added this to the January 2022 milestone Jan 24, 2022
@ghost ghost assigned rzhao271 and isidorn Jan 25, 2022
@rzhao271 rzhao271 removed their assignment Jan 25, 2022
@isidorn isidorn removed their assignment Jan 25, 2022
@isidorn isidorn closed this as completed Jan 25, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants