Skip to content

fix(ct): correctly work in headless mode #1111

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

Merged
merged 1 commit into from
Jul 17, 2025

Conversation

DudaGod
Copy link
Member

@DudaGod DudaGod commented Jul 16, 2025

What is done?

  • we need to wait response from master when emit init event from worker

Copy link

pkg-pr-new bot commented Jul 16, 2025

Open in StackBlitz

npm i https://pkg.pr.new/gemini-testing/testplane@1111

commit: bf0ae22


cb(null);
} catch (err) {
cb(prepareError(err as Error));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now event in master return null or error to worker in order to inform that everything was completed and worker can open vite url. Previously, the worker opened the url without waiting and this led to errors.

@@ -191,7 +191,7 @@ export class TestRunner extends NodejsEnvTestRunner {
this._handleRunExpectMatcher(browser, expectMatchers),
);

this._socket.emit(WorkerEventNames.initialize, {
const err = (await this._socket.timeout(SOCKET_MAX_TIMEOUT).emitWithAck(WorkerEventNames.initialize, {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

emitWithAck - emitted event and wait response from master

@@ -425,8 +439,6 @@ describe("worker/browser-env/runner/test-runner", () => {
const promise = run_();
await clock.tickAsync(1);
socket.emit(BrowserEventNames.initialize, []);

await clock.tickAsync(1);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test and test below fails in trunk after remove bluebird. I fix them by remove this timeout

@DudaGod DudaGod merged commit 1d593d9 into master Jul 17, 2025
5 of 11 checks passed
@DudaGod DudaGod deleted the TESTPLANE-611.ct_fix_in_headless_mode branch July 17, 2025 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants