简体   繁体   English

tox+pytest 仅在 travis 上给出代码为 -11 的调用错误

[英]tox+pytest gives invocation error with code -11 only on travis

I have code that, when I test with tox locally, passes all tests.我有代码,当我在本地使用 tox 进行测试时,可以通过所有测试。 However, on Travis, it gives the following error:但是,在 Travis 上,它给出了以下错误:

tests/test_cli.py::test_spin ERROR: InvocationError for command /home/travis/build/21cmfast/21cmFAST/.tox/py36/bin/py.test -vv --basetemp=/home/travis/build/21cmfast/21cmFAST/.tox/py36/tmp --cov py21cmfast (exited with code -11)
___________________________________ summary ____________________________________
ERROR:   py36: commands failed

The command "tox" exited with 1.

Full output at https://travis-ci.org/21cmfast/21cmFAST/jobs/545483077完整输出https://travis-ci.org/21cmfast/21cmFAST/jobs/545483077

Does anyone know what code -11 means?有谁知道代码 -11 是什么意思? And have any idea why it would be failing on travis but not locally?知道为什么它会在 travis 上失败而不是在本地失败吗?

One thing of possible note... test_spin is a reasonably intensive function.可能需要注意的一件事... test_spin是一个相当密集的功能。

The error is hiding in the hardcoded path here:错误隐藏在硬编码路径中:

EXTERNALTABLES = ffi.new("char[]", path.join(path.expanduser("~"), ".21CMMC").encode())
global_params.external_table_path = EXTERNALTABLES

The Travis environment doesn't have the path ~/.21CMMC defined, thus reading attempts from there will fail, resulting in a segfault. Travis 环境没有定义路径~/.21CMMC ,因此从那里读取尝试将失败,导致段错误。 If you dump the traceback on a SIGSEGV signal, you'll see an output similar to this one:如果您在SIGSEGV信号上转储回溯,您将看到与此类似的输出:

tests/test_cli.py::test_spin T_RECFAST: Unable to open file: /home/travis/.21CMMC/External_tables/recfast_LCDM.dat for reading
Aborting
Called xion_RECFAST with z=35.000000, bailing out!
Called xion_RECFAST with z=35.000000, bailing out!
Fatal Python error: Segmentation fault
Current thread 0x00007fba4012d700 (most recent call first):
  File "/home/travis/build/21cmFAST/21cmFAST/.tox/py36/lib/python3.6/site-packages/py21cmfast/wrapper.py", line 765 in _call_c_func
  File "/home/travis/build/21cmFAST/21cmFAST/.tox/py36/lib/python3.6/site-packages/py21cmfast/wrapper.py", line 1641 in spin_temperature
  File "/home/travis/build/21cmFAST/21cmFAST/.tox/py36/lib/python3.6/site-packages/py21cmfast/cli.py", line 264 in spin
  File "/home/travis/build/21cmFAST/21cmFAST/.tox/py36/lib/python3.6/site-packages/click/decorators.py", line 17 in new_func
  File "/home/travis/build/21cmFAST/21cmFAST/.tox/py36/lib/python3.6/site-packages/click/core.py", line 555 in invoke
  File "/home/travis/build/21cmFAST/21cmFAST/.tox/py36/lib/python3.6/site-packages/click/core.py", line 956 in invoke
  File "/home/travis/build/21cmFAST/21cmFAST/.tox/py36/lib/python3.6/site-packages/click/core.py", line 1137 in invoke
  File "/home/travis/build/21cmFAST/21cmFAST/.tox/py36/lib/python3.6/site-packages/click/core.py", line 717 in main
  File "/home/travis/build/21cmFAST/21cmFAST/.tox/py36/lib/python3.6/site-packages/click/testing.py", line 326 in invoke
  File "/home/travis/build/21cmFAST/21cmFAST/tests/test_cli.py", line 116 in test_spin
  ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM