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

Cypress tests hang in RStudio on MacOS #548

Open
kamilzyla opened this issue Jan 17, 2024 · 1 comment
Open

Cypress tests hang in RStudio on MacOS #548

kamilzyla opened this issue Jan 17, 2024 · 1 comment

Comments

@kamilzyla
Copy link
Collaborator

kamilzyla commented Jan 17, 2024

Steps to reproduce

  1. Initialize a fresh Rhino project in RStudio.
  2. Run rhino::test_e2e() in R console.

Bug description

The process hangs after launching the app:

1

The app is accessible through the browser, but it start-server-and-test doesn't seem to notice and Cypress doesn't launch. After a couple of minutes an error we get an error:

2

Expected behavior

The tests should run normally.

Rhino diagnostics

Darwin 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:59:33 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T8112
R version 4.3.2 (2023-10-31)
rhino: 1.5.0
node: v18.18.0

Comments

The issue was reported by @Johan-rosa. After some digging we discovered that:

  1. The issue seems to be somehow caused by RStudio. Running system2("npm", c("run", "test-e2e")) in RStudio R console hangs like above; running the same command in R started from the terminal works fine.
  2. In our case the PATH settings and node --version differed in R console and terminal, but it didn't seem to affect the results (we used explicit path to the same executable and it still hanged in RStudio).

Workaround

If you encounter this issue, please let us know! We still don't know the root cause and any help in reproducing the issue would be valuable. Meanwhile, you can run E2E tests by running the following command in the terminal (assuming you are in the project root):

(cd .rhino && npm run test-e2e)
@kamilzyla
Copy link
Collaborator Author

The following command can be used to troubleshoot:

DEBUG=start-server-and-test npm run test-e2e

Forcing start-server-and-test to use HTTP GET requests seems to resolve the issue (ref):

start-server-and-test http-get://localhost:8080

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

No branches or pull requests

1 participant