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

aio app test is failing on EBADF bad file descriptor (Windows only) #372

Open
davidbenge opened this issue Feb 2, 2021 · 8 comments · Fixed by #415
Open

aio app test is failing on EBADF bad file descriptor (Windows only) #372

davidbenge opened this issue Feb 2, 2021 · 8 comments · Fixed by #415
Assignees
Labels
bug Something isn't working

Comments

@davidbenge
Copy link

Expected Behaviour

On Windows i expect to be able to test my firefly application by running the command aio app test

Actual Behaviour

Crash

`D:\code\2021\git\demos\gettingstarted>aio app test
child_process.js:114
  p.open(fd);
    ^

Error: EBADF: bad file descriptor, uv_pipe_open
    at Object._forkChild (child_process.js:114:5)
    at setupChildProcessIpcChannel (internal/bootstrap/pre_execution.js:328:30)
    at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:49:3)
    at internal/main/run_main_module.js:7:1 {
  errno: -4083,
  code: 'EBADF',
  syscall: 'uv_pipe_open'
}
 »   Error: Command failed with ENOENT: jest --passWithNoTests ./test
 »   spawn jest ENOENT`

Reproduce Scenario (including but not limited to)

aio app init getting started
Adobe IO Demo org
default options the rest of the way

Steps to Reproduce

Environment Info

  System:
    OS: Windows 10 10.0.19042
    CPU: (8) x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
    Memory: 23.78 GB / 47.91 GB
  Binaries:
    Node: 12.13.0
    Yarn: 1.22.5
    npm: 6.12.0
  Virtualization:
    Docker: 20.10.2
  npmGlobalPackages:
    @adobe/aio-cli: Not Found

Sample Code that illustrates the problem

Logs taken while reproducing problem

@shazron shazron changed the title new bug report aio app test is failing on EBADF bad file descriptor (Windows only) Feb 2, 2021
@aiojbot
Copy link
Collaborator

aiojbot commented Feb 2, 2021

JIRA issue created: https://jira.corp.adobe.com/browse/ACNA-1026

@shazron
Copy link
Member

shazron commented Feb 2, 2021

also add aio app test to the e2e tests for the aio-cli, and add the e2e tests to the Github Actions.

@shazron shazron transferred this issue from adobe/aio-cli Feb 2, 2021
@meryllblanchet meryllblanchet added the bug Something isn't working label Feb 2, 2021
@shazron shazron self-assigned this Jun 14, 2021
@shazron
Copy link
Member

shazron commented Jun 14, 2021

SImilar issue related to execa and cross-spawn on Windows (see section Issue with cross-spawn): netlify/build#387

@shazron
Copy link
Member

shazron commented Jun 14, 2021

cross-spawn issue (still open, related to the ipc option I'm using for supporting aio-run-detached): moxystudio/node-cross-spawn#137

@shazron
Copy link
Member

shazron commented Jun 14, 2021

Looks like @sandeep-paliwal filed an issue on exec but it was closed with no resolution. Any insight Sandeep? sindresorhus/execa#448

@sandeep-paliwal
Copy link
Contributor

@shazron yeah it was not resolved, there were few suggestion to try out but none worked. So we used a workaround in our GH actions not to use directly aio app test but invoke the jest command to launch the tests.

@adobe adobe deleted a comment from aiojbot Jun 24, 2021
@shazron
Copy link
Member

shazron commented Jun 24, 2021

still occurs on node 16.3.0

@shazron
Copy link
Member

shazron commented Aug 4, 2023

See https://github.com/netlify/build/pull/388/files for a fix.
See discussion netlify/build#387 (comment)

In a nutshell, we need to call process.execPath on the execa command while on Windows. Untested.

const child = execa.command(command, {

@shazron shazron added bug Something isn't working and removed bug Something isn't working labels Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
5 participants