Skip to content

NativeScript cli does not stop with Karma with singleRun: true #5617

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

Closed
3 tasks done
edusperoni opened this issue Jan 14, 2022 · 1 comment · Fixed by #5618
Closed
3 tasks done

NativeScript cli does not stop with Karma with singleRun: true #5617

edusperoni opened this issue Jan 14, 2022 · 1 comment · Fixed by #5618
Labels
bug-pending-triage Reported bug, pending triage to confirm.

Comments

@edusperoni
Copy link
Collaborator

edusperoni commented Jan 14, 2022

Issue Description

When run with singleRun: true the nativescript cli will no longer exit at the end of the process, which makes us unable to detect the exit code (success/fail on unit test run) and hangs CI

Reproduction

  1. create new project
  2. ns test init
  3. change to singleRun: true
  4. ns test android/ios
  5. karma will die but the cli won't report the exit code and will hang

Relevant log output (if applicable)

14 01 2022 02:23:47.950:DEBUG [NativeScript / 28 (9; AOSP on IA Emulator)]: EXECUTING -> CONNECTED

Finished in 8.803 secs / 7.01 secs @ 02:23:47 GMT-0300 (Brasilia Standard Time)

SUMMARY:
✔ 11 tests completed
14 01 2022 02:23:47.953:DEBUG [karma-server]: Run complete, exiting.
14 01 2022 02:23:47.954:DEBUG [launcher]: Disconnecting all browsers
14 01 2022 02:23:47.954:DEBUG [launcher]: null -> BEING_KILLED
14 01 2022 02:23:47.954:DEBUG [launcher]: BEING_KILLED -> BEING_FORCE_KILLED
14 01 2022 02:23:47.955:DEBUG [proxy]: Destroying proxy agents
14 01 2022 02:23:47.955:DEBUG [launcher]: BEING_FORCE_KILLED -> FINISHED
14 01 2022 02:23:47.956:WARN [NativeScript / 28 (9; AOSP on IA Emulator)]: Disconnected (0 times) Client disconnected from CONNECTED state (server shutting down)
NativeScript / 28 (9; AOSP on IA Emulator) ERROR
  Disconnected Client disconnected from CONNECTED state (server shutting down)
14 01 2022 02:23:47.957:DEBUG [NativeScript / 28 (9; AOSP on IA Emulator)]: CONNECTED -> DISCONNECTED
JS: NSUTR-socket.io: transport error
JS: NSUTR: completeAck

Environment

No response

Please accept these terms

@edusperoni edusperoni added the bug-pending-triage Reported bug, pending triage to confirm. label Jan 14, 2022
@edusperoni
Copy link
Collaborator Author

edusperoni commented Jan 14, 2022

this is probably the best starting point to debug this:

https://github.com/NativeScript/nativescript-cli/blob/master/lib/services/karma-execution.ts#L13

it does call that function with the exit code, but the cli process doesn't exit

Edit:

The issue only happens on successful runs. It seems it just never completes from:

await this.$testExecutionService.startKarmaServer(
this.platform,
liveSyncInfo,
deviceDescriptors
);

That promise either resolves (cli hangs) or rejects (cli exits with error code 1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-pending-triage Reported bug, pending triage to confirm.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant