Tag: 鼻子

make:*** 分割错误(core dump)

我试图在连接到docker集装箱的GitLab CI系统中使用nosetests来运行我的库的testing。 在运行nosetests时,会出现没有任何进一步信息的SegmentationFault: Running with gitlab-ci-multi-runner 9.2.1 (f018144) on geomultisens_ci (13021243) Using Docker executor with image mylib_ci:latest … Using docker image sha256:fb484ffc20b0b7f5e67fe5b9dbcc6273b0473b9e221c1576382f33ba291acdc6 for predefined container… Pulling docker image mylib_ci:latest … Using docker image mylib_ci:latest ID=sha256:1ab9379705dfbde4bbe3db9207d8f614f7b0a19399de305266ec4d372ea9556e for build container… Running on runner-13021243-project-32-concurrent-0 via 64818bb9939b… Cloning repository… Cloning into '/builds/user1/mylib'… Checking out 28f23b52 as nosetests… Skipping Git […]

docker-compose yml在Docker中运行nosetests,输出到控制台被延迟

当我使用docker-compose run integration_tests fab tests.integration_tests运行在testing目录中的testing上运行nosetests的fab任务时,我会看到按照我的预期stream式传输到屏幕上的testing输出,包括运行每个testing时的进度点。 但是,当我尝试使用docker-compose -f tests.yml up integration_tests运行相同的命令时docker-compose -f tests.yml up integration_tests输出会以块的forms出现,就好像它被缓冲并间隔地写入屏幕一样。 如何在使用yml文件时使输出stream连续传输? 我的tests.yml文件(版本2.3)包含: integration_tests: image: my_service command: fab tests.integration_tests tty: true

如何编写一个unit testing来检查在瞬态系统资源约束条件下的正确行为?

我有一个Python 3应用程序,它使用多处理模块并行地在许多CPU上分布大量的资源密集型科学计算。 计算中有几个步骤要求进程分配适度大的数组。 当我在OS X笔记本电脑上运行该应用程序时,该应用程序运行良好,但长期计划是,它通常会从Docker容器中运行,然后运行在Amazon Web Services EC2实例或其他类似云的虚拟机 – 将应用程序embedded到两个级别的机器虚拟化技术中。 我预计未来,其他一些用户可能会尝试运行带有虚拟机资源(内存,交换空间等)的应用程序,该资源被configuration为设置的值太小,太小。 (有明确的财务激励措施可以做到这一点,因为您对云计算服务的支付往往较less,所用的资源也较less。) 这就提出了在严格限制资源的情况下,当一个足够大的内存块暂时不可用时,其中一个进程可能会尝试为数组分配内存,从而触发Python MemoryErrorexception。 这个问题的解决scheme可能看起来像下面的代码片段:尝试分配内存,如果发生exception,请稍等片刻,然后再试一次: import numpy as np import time import datetime import os from warnings import warn def getHugeArray(n, retry=1, warnuser=5): # Don't retry too often if retry < 0.1: retry = 1 # Don't send a useless flood of warning messages if […]

有nosetests从容器外观看文件,并在容器内重新运行testing

我怎样才能在docker集装箱外进行开发,但仍然有鼻子检测我的文件更改,并重新运行在容器内的unit testing? 这是我的Dockerfile FROM ubuntu # Install Python. RUN \ apt-get update && \ apt-get install -y python python-dev python-pip python-virtualenv && \ rm -rf /var/lib/apt/lists/* && \ pip install nose nose-watch mock && \ locale-gen en_US.UTF-8 # Define working directory. WORKDIR /data/test/src # Define default command. CMD ["bash"] 这是我的命令: docker build -t="test” . docker […]