【问题标题】:make test failed when compile Node.js 4.0.0 source code in docker container在 docker 容器中编译 Node.js 4.0.0 源代码时使测试失败
【发布时间】:2015-09-12 13:32:13
【问题描述】:

我在 Python 2.7.10 docker 容器中编译 Node.js 4.0.0 源代码时发生了 make test 失败。

首先,我只是用Docker官方Python 2.7.10镜像运行一个容器,容器有gcc 4.9,make 4.0,python 2.7,满足Node.js 4.0.0的需求。

然后在容器中操作(登录到容器的shell)。

在 /usr/src/nodejs 中下载 Node.js 4.0.0 源代码并在下面运行

./configure && make && make install && make test

进程停止在make test,错误信息是:


    === release test-tick-processor ===                                            
Path: parallel/test-tick-processor
nm: '/var/lib/docker/aufs/diff/9f4978cc45a4e08268de6e77e49c6e837ab58eb204846975b6db6e5474769d7b/usr/src/nodejs/out/Release/node': No such file
nm: '/var/lib/docker/aufs/diff/843e2bded49837e4846422f3a82a67be3ccc46c3e636e03d8d946c57564468ba/lib/x86_64-linux-gnu/libc-2.19.so': No such file
nm: '/var/lib/docker/aufs/diff/843e2bded49837e4846422f3a82a67be3ccc46c3e636e03d8d946c57564468ba/lib/x86_64-linux-gnu/libpthread-2.19.so': No such file
nm: '/var/lib/docker/aufs/diff/843e2bded49837e4846422f3a82a67be3ccc46c3e636e03d8d946c57564468ba/lib/x86_64-linux-gnu/libgcc_s.so.1': No such file
nm: '/var/lib/docker/aufs/diff/843e2bded49837e4846422f3a82a67be3ccc46c3e636e03d8d946c57564468ba/lib/x86_64-linux-gnu/libm-2.19.so': No such file
nm: '/var/lib/docker/aufs/diff/843e2bded49837e4846422f3a82a67be3ccc46c3e636e03d8d946c57564468ba/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20': No such file
nm: '/var/lib/docker/aufs/diff/843e2bded49837e4846422f3a82a67be3ccc46c3e636e03d8d946c57564468ba/lib/x86_64-linux-gnu/librt-2.19.so': No such file
nm: '/var/lib/docker/aufs/diff/843e2bded49837e4846422f3a82a67be3ccc46c3e636e03d8d946c57564468ba/lib/x86_64-linux-gnu/libdl-2.19.so': No such file
nm: '/var/lib/docker/aufs/diff/843e2bded49837e4846422f3a82a67be3ccc46c3e636e03d8d946c57564468ba/lib/x86_64-linux-gnu/ld-2.19.so': No such file

assert.js:89
  throw new assert.AssertionError({
  ^
AssertionError: null == true
    at Object. (/usr/src/nodejs/test/parallel/test-tick-processor.js:34:1)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:475:10)
    at startup (node.js:117:18)
    at node.js:951:3
Command: out/Release/node /usr/src/nodejs/test/parallel/test-tick-processor.js

test-tick-processor.js 的开头有var fs = require('fs');。我认为这个命令给出了导致问题的错误目录。

如何解决此问题以确保正确安装了 Node.js 4.0.0?

【问题讨论】:

    标签: node.js docker


    【解决方案1】:

    在撰写本文时,对您而言失败的 test-tick-processor 测试在 Node.js 中是不稳定的。有来自核心贡献者的an open issue about it 包括此评论(11 天前):

    似乎这个测试至少在所有 Linux 平台上都是不稳定的(在 armv7 中的失败率可能要高得多)。

    make test 通过的一些选项包括:

    • 再次运行make test,看看测试是否通过
    • 通过从源中删除文件 test/parallel/test-tick-processor.js 来禁用测试

    require('fs') 行不是问题。 fs 是一个内置模块,不需要目录。如果这条线爆炸了,您将不会收到AssertionError。堆栈跟踪表明断言在文件的第 34 行失败。

    【讨论】:

    • 非常感谢。我看到了票,这肯定是我的麻烦。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-15
    • 1970-01-01
    • 2020-06-05
    • 2017-05-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多