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

authz.schemaRegistry test suite setup/teardown is flaky #426

Open
shouples opened this issue Oct 22, 2024 · 0 comments
Open

authz.schemaRegistry test suite setup/teardown is flaky #426

shouples opened this issue Oct 22, 2024 · 0 comments
Labels
bug Something isn't working testing Involves the test suite, click-testing, or CI processes

Comments

@shouples
Copy link
Contributor

shouples commented Oct 22, 2024

No idea what causes this, but we see the beforeEach()/afterEach() in https://github.com/confluentinc/vscode/blob/main/src/authz/schemaRegistry.test.ts fail occasionally in CI:
image

Test output:

  207 passing (15s)02:28
  2 failing02:28
  1) authz.schemaRegistry02:28
       "before each" hook for "canAccessSchemaTypeForTopic() should return true if environmentId is not present":02:28
     Error: Timeout of 10000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/semaphore/vscode/out/src/authz/schemaRegistry.test.js)02:28
  	at listOnTimeout (node:internal/timers:581:17)02:28
  	at process.processTimers (node:internal/timers:519:7)02:28
 02:28
  2) authz.schemaRegistry02:28
       "after each" hook for "canAccessSchemaTypeForTopic() should return true if environmentId is not present":02:28
     TypeError: Cannot read properties of undefined (reading 'restore')02:28
  	at Context.<anonymous> (out/src/authz/schemaRegistry.test.js:56:13)02:28
  	at process.processImmediate (node:internal/timers:483:21)02:28
  	at process.callbackTrampoline (node:internal/async_hooks:130:17)02:28
 02:28
Error: 2 tests failed.02:28
	at Object.run (/home/semaphore/vscode/out/src/testing.js:9:1062)02:28
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)02:28
Extension host test runner error Error: 2 tests failed.02:28
	at Object.run (/home/semaphore/vscode/out/src/testing.js:9:1062)02:28
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)02:28
Asking native host service to exit with code 1.

Rerunning the workflow usually fixes it, but seeing them fail a few times a week isn't great.

The second failure (Cannot read properties of undefined (reading 'restore')) could probably be solved by creating the sandbox sooner or check whether it's a SinonSandbox vs undefined before calling .restore(), but the timeout may be related to latency activating the extension between tests, and may be better placed in a before() block instead of beforeEach().

@shouples shouples added bug Something isn't working testing Involves the test suite, click-testing, or CI processes labels Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working testing Involves the test suite, click-testing, or CI processes
Projects
None yet
Development

No branches or pull requests

1 participant