Skip to content

test failures on Android #1430

Description

@shigeki

As commented in #1396 (comment) , several tests fails on Android.
Some of them can be tentatively fixed by a small patch but 18 failures still remains.
The patch and full test results( --mode=release message parallel sequential) are show in
https://gist.github.com/shigeki/fd25f15657f058ceccea and the list of failures are

$ grep 'not ok' test_out.txt
not ok 16 - test-child-process-default-options.js
not ok 20 - test-child-process-env.js
not ok 23 - test-child-process-exec-env.js
not ok 59 - test-cluster-bind-privileged-port.js
not ok 87 - test-cluster-shared-handle-bind-privileged-port.js
not ok 202 - test-fs-access.js
not ok 229 - test-fs-readfile-pipe.js
not ok 230 - test-fs-readfile-pipe-large.js
not ok 233 - test-fs-readfilesync-pipe-large.js
not ok 262 - test-http-304.js
not ok 307 - test-http-curl-chunk-problem.js
not ok 321 - test-http-full-response.js
not ok 415 - test-https-simple.js
not ok 477 - test-net-pipe-connect-errors.js
not ok 514 - test-process-config.js
not ok 577 - test-stdio-closed.js
not ok 779 - test-child-process-execsync.js
not ok 785 - test-fs-watch.js

4 failures are because process.getuid is undefined on Android and some of them can be fixed by changing to invoke external commands. It needs more investigations.

CC: @Gioyik

Activity

  1. added
    testIssues and PRs related to Node.js core tests and test infrastructure.
    on Apr 15, 2015
  2. Gioyik commented on Apr 16, 2015

    @Gioyik
    Contributor

    Tomorrow I am going to run the tests and check if I can patch some tests. I am seeing that the build of iojs is not working on armv7l devices, I am getting this on armv7l devices:

    assertion "(err) == (0)" failed: file "../src/node.cc", line 3481, function "void node::PlatformInit()"
    [1] + Stopped (signal)     ./iojs 
    

    @shigeki could you give the result of uname -a on the device you tested? I want to identify on what armv7 is working and on which one is not.

    Added to it, I want to work on fix the way configure is detecting the macros of compiler binaries from Android NDK, but maybe that should be discussed in other issues after solve this first.

  3. bnoordhuis commented on Apr 16, 2015

    @bnoordhuis
    Member

    I suspect that's because of the pthread_sigmask() in PlatformInit; IIRC, in Android it was broken until Jellybean. Can you try this patch?

    diff --git a/src/node.cc b/src/node.cc
    index 67cf140..f32a1a0 100644
    --- a/src/node.cc
    +++ b/src/node.cc
    @@ -3463,7 +3463,13 @@ inline void PlatformInit() {
       sigset_t sigmask;
       sigemptyset(&sigmask);
       sigaddset(&sigmask, SIGUSR1);
    -  const int err = pthread_sigmask(SIG_SETMASK, &sigmask, nullptr);
    +  int err = pthread_sigmask(SIG_SETMASK, &sigmask, nullptr);
    +
    +#ifdef __ANDROID__
    +  // Android < 4.1 has a broken pthread_sigmask() implementation.
    +  if (err == EINVAL)
    +    err = sigprocmask(SIG_SETMASK, &sigmask, nullptr);
    +#endif
    
       // Make sure file descriptors 0-2 are valid before we start logging anything.
       for (int fd = STDIN_FILENO; fd <= STDERR_FILENO; fd += 1) {
  4. shigeki commented on Apr 16, 2015

    @shigeki
    ContributorAuthor

    @Gioyik I never had such an error on my Android (Lolipop) so probably it comes from the issue that is pointed out by Ben. My device's output is

    root@mako:/ # uname -a
    Linux localhost 3.4.0-perf-g16e203d #1 SMP PREEMPT Wed Nov 19 05:47:52 UTC 2014 armv7l GNU/Linux
    root@mako:/ # grep -e ro.product.cpu  -e ro.build.version /system/build.prop

    and build.prop is in https://gist.github.com/shigeki/9a5db4c9ea0e3da978fd .

    I made tentative fixes to pass all the tests on my Android in https://github.com/shigeki/io.js/tree/android-fix .
    Please test it if it works on your device.

  5. Trott commented on Feb 11, 2016

    @Trott
    Member

    Is it not-onerous to get an update on this? I don't suppose it's been quietly fixed in the last nine months or something?

  6. shigeki commented on Mar 22, 2016

    @shigeki
    ContributorAuthor

    I don't have an android device to run tests on Android now. So I close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testIssues and PRs related to Node.js core tests and test infrastructure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions