{"action":"created","issue":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/1029","labels_url":"https://api.github.com/repos/pytest-dev/pytest/issues/1029/labels{/name}","comments_url":"https://api.github.com/repos/pytest-dev/pytest/issues/1029/comments","events_url":"https://api.github.com/repos/pytest-dev/pytest/issues/1029/events","html_url":"https://github.com/pytest-dev/pytest/issues/1029","id":107425753,"number":1029,"title":"pytest2.8  invariantly writes to working directory + fails on readonly filesystem","user":{"login":"asottile","id":1810591,"avatar_url":"https://avatars.githubusercontent.com/u/1810591?v=3","gravatar_id":"","url":"https://api.github.com/users/asottile","html_url":"https://github.com/asottile","followers_url":"https://api.github.com/users/asottile/followers","following_url":"https://api.github.com/users/asottile/following{/other_user}","gists_url":"https://api.github.com/users/asottile/gists{/gist_id}","starred_url":"https://api.github.com/users/asottile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asottile/subscriptions","organizations_url":"https://api.github.com/users/asottile/orgs","repos_url":"https://api.github.com/users/asottile/repos","events_url":"https://api.github.com/users/asottile/events{/privacy}","received_events_url":"https://api.github.com/users/asottile/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pytest-dev/pytest/labels/backward%20compatibility","name":"backward compatibility","color":"f7c6c7"},{"url":"https://api.github.com/repos/pytest-dev/pytest/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/pytest-dev/pytest/labels/easy","name":"easy","color":"bfe5bf"}],"state":"open","locked":false,"assignee":{"login":"RonnyPfannschmidt","id":156838,"avatar_url":"https://avatars.githubusercontent.com/u/156838?v=3","gravatar_id":"","url":"https://api.github.com/users/RonnyPfannschmidt","html_url":"https://github.com/RonnyPfannschmidt","followers_url":"https://api.github.com/users/RonnyPfannschmidt/followers","following_url":"https://api.github.com/users/RonnyPfannschmidt/following{/other_user}","gists_url":"https://api.github.com/users/RonnyPfannschmidt/gists{/gist_id}","starred_url":"https://api.github.com/users/RonnyPfannschmidt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RonnyPfannschmidt/subscriptions","organizations_url":"https://api.github.com/users/RonnyPfannschmidt/orgs","repos_url":"https://api.github.com/users/RonnyPfannschmidt/repos","events_url":"https://api.github.com/users/RonnyPfannschmidt/events{/privacy}","received_events_url":"https://api.github.com/users/RonnyPfannschmidt/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/pytest-dev/pytest/milestones/6","html_url":"https://github.com/pytest-dev/pytest/milestones/2.8.3","labels_url":"https://api.github.com/repos/pytest-dev/pytest/milestones/6/labels","id":1348333,"number":6,"title":"2.8.3","description":"","creator":{"login":"RonnyPfannschmidt","id":156838,"avatar_url":"https://avatars.githubusercontent.com/u/156838?v=3","gravatar_id":"","url":"https://api.github.com/users/RonnyPfannschmidt","html_url":"https://github.com/RonnyPfannschmidt","followers_url":"https://api.github.com/users/RonnyPfannschmidt/followers","following_url":"https://api.github.com/users/RonnyPfannschmidt/following{/other_user}","gists_url":"https://api.github.com/users/RonnyPfannschmidt/gists{/gist_id}","starred_url":"https://api.github.com/users/RonnyPfannschmidt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RonnyPfannschmidt/subscriptions","organizations_url":"https://api.github.com/users/RonnyPfannschmidt/orgs","repos_url":"https://api.github.com/users/RonnyPfannschmidt/repos","events_url":"https://api.github.com/users/RonnyPfannschmidt/events{/privacy}","received_events_url":"https://api.github.com/users/RonnyPfannschmidt/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":0,"state":"open","created_at":"2015-10-10T09:08:16Z","updated_at":"2015-10-16T11:50:16Z","due_on":null,"closed_at":null},"comments":15,"created_at":"2015-09-21T00:09:05Z","updated_at":"2015-10-16T15:06:17Z","closed_at":null,"body":"I believe these to be the same issue so I'm only making a single report.\r\n\r\n```\r\n$ virtualenv venv\r\n...\r\n$ . venv/bin/activate\r\n$ pip install pytest\r\n...\r\n$ py.test foo.py\r\n============================= test session starts ==============================\r\nplatform linux2 -- Python 2.7.6, pytest-2.8.0, py-1.4.30, pluggy-0.3.1\r\nrootdir: /tmp/foo, inifile: \r\n\r\n===============================  in 0.00 seconds ===============================\r\nERROR: file not found: foo.py\r\n(venv)asottile@work:/tmp/foo$ ls -al .cache/v/cache/lastfailed \r\n-rw-rw-r-- 1 asottile asottile 2 Sep 20 17:03 .cache/v/cache/lastfailed\r\n```\r\n\r\nAnd the error from our CI server (which is running a repo inside docker)\r\n\r\n```\r\n15:06:43 docker run -t -v /nail/scratch/jenkins_prod_slave/workspace/packages-ubuntu-allocate_playground:/work:ro nginx_test_container /bin/bash -c \"cd /work/itest && . /venv34/bin/activate && py.test -s test_nginx.py\"\r\n15:06:43 ============================= test session starts ==============================\r\n15:06:43 platform linux -- Python 3.4.2, pytest-2.8.0, py-1.4.30, pluggy-0.3.1\r\n15:06:43 rootdir: /work, inifile: \r\n15:06:43 \r\ncollecting 0 items\r\ncollecting 5 items\r\ncollected 5 items \r\n15:06:43 \r\n15:06:44 test_nginx.py\r\n...\r\n15:06:51 .Traceback (most recent call last):\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/py/_error.py\", line 64, in checked_call\r\n15:06:51     return func(*args, **kwargs)\r\n15:06:51 OSError: [Errno 30] Read-only file system: '/work/.cache/v/cache/lastfailed'\r\n15:06:51 \r\n15:06:51 During handling of the above exception, another exception occurred:\r\n15:06:51 \r\n15:06:51 Traceback (most recent call last):\r\n15:06:51   File \"/venv34/bin/py.test\", line 11, in <module>\r\n15:06:51     sys.exit(main())\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/_pytest/config.py\", line 48, in main\r\n15:06:51     return config.hook.pytest_cmdline_main(config=config)\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py\", line 724, in __call__\r\n15:06:51     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py\", line 338, in _hookexec\r\n15:06:51     return self._inner_hookexec(hook, methods, kwargs)\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py\", line 333, in <lambda>\r\n15:06:51     _MultiCall(methods, kwargs, hook.spec_opts).execute()\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py\", line 596, in execute\r\n15:06:51     res = hook_impl.function(*args)\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/_pytest/main.py\", line 115, in pytest_cmdline_main\r\n15:06:51     return wrap_session(config, _main)\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/_pytest/main.py\", line 110, in wrap_session\r\n15:06:51     exitstatus=session.exitstatus)\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py\", line 724, in __call__\r\n15:06:51     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py\", line 338, in _hookexec\r\n15:06:51     return self._inner_hookexec(hook, methods, kwargs)\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py\", line 333, in <lambda>\r\n15:06:51     _MultiCall(methods, kwargs, hook.spec_opts).execute()\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py\", line 595, in execute\r\n15:06:51     return _wrapped_call(hook_impl.function(*args), self.execute)\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py\", line 249, in _wrapped_call\r\n15:06:51     wrap_controller.send(call_outcome)\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/_pytest/terminal.py\", line 361, in pytest_sessionfinish\r\n15:06:51     outcome.get_result()\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py\", line 278, in get_result\r\n15:06:51     raise ex[1].with_traceback(ex[2])\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py\", line 264, in __init__\r\n15:06:51     self.result = func()\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py\", line 596, in execute\r\n15:06:51     res = hook_impl.function(*args)\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/_pytest/cacheprovider.py\", line 140, in pytest_sessionfinish\r\n15:06:51     config.cache.set(\"cache/lastfailed\", self.lastfailed)\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/_pytest/cacheprovider.py\", line 73, in set\r\n15:06:51     with path.open(\"w\") as f:\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/py/_path/local.py\", line 353, in open\r\n15:06:51     return py.error.checked_call(open, self.strpath, mode)\r\n15:06:51   File \"/venv34/lib/python3.4/site-packages/py/_error.py\", line 84, in checked_call\r\n15:06:51     raise cls(\"%s%r\" % (func.__name__, args))\r\n15:06:51 py.error.EROFS: [Read-only file system]: open('/work/.cache/v/cache/lastfailed', 'w')\r\n15:06:51 make: *** [itest] Error 1\r\n...\r\n```"},"comment":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/comments/148741370","html_url":"https://github.com/pytest-dev/pytest/issues/1029#issuecomment-148741370","issue_url":"https://api.github.com/repos/pytest-dev/pytest/issues/1029","id":148741370,"user":{"login":"asottile","id":1810591,"avatar_url":"https://avatars.githubusercontent.com/u/1810591?v=3","gravatar_id":"","url":"https://api.github.com/users/asottile","html_url":"https://github.com/asottile","followers_url":"https://api.github.com/users/asottile/followers","following_url":"https://api.github.com/users/asottile/following{/other_user}","gists_url":"https://api.github.com/users/asottile/gists{/gist_id}","starred_url":"https://api.github.com/users/asottile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asottile/subscriptions","organizations_url":"https://api.github.com/users/asottile/orgs","repos_url":"https://api.github.com/users/asottile/repos","events_url":"https://api.github.com/users/asottile/events{/privacy}","received_events_url":"https://api.github.com/users/asottile/received_events","type":"User","site_admin":false},"created_at":"2015-10-16T15:06:17Z","updated_at":"2015-10-16T15:06:17Z","body":"Here's a oneliner that reproduces:\r\n\r\n```\r\nrm -rf foo && mkdir foo && touch foo/test.py && docker run -ti -v \"$PWD/foo:/code:ro\" ubuntu bash -c 'apt-get update && apt-get install -y python-pip && pip install pytest && cd /code && py.test test.py'\r\n```\r\n\r\nThe trace above can be reproduced by:\r\n\r\n```\r\nrm -rf foo && mkdir foo && touch foo/test.py && mkdir -p foo/.cache/v/cache && docker run -ti -v \"$PWD/foo:/code:ro\" ubuntu bash -c 'apt-get update && apt-get install -y python-pip && pip install pytest && cd /code && py.test test.py'\r\n```\r\n\r\nYou'll probably have a faster debug loop with a dockerfile that looks something like (not tested):\r\n\r\n```\r\nFROM ubuntu\r\nRUN apt-get update && apt-get install -y python-pip\r\nRUN pip install pytest\r\nCMD cd /code && py.test test.py\r\n```"}}