{"html_url": "https://github.com/simonw/datasette/issues/1843#issuecomment-1356480256", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1843", "id": 1356480256, "node_id": "IC_kwDOBm6k_c5Q2j8A", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-17T22:01:13Z", "updated_at": "2022-12-17T22:01:13Z", "author_association": "OWNER", "body": "The refactor in the following issue did NOT prevent this error from occurring when I try to run the full `pytest` suite on my Mac laptop:\r\n\r\n- #1959", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1408757705, "label": "Intermittent \"Too many open files\" error running tests"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1843#issuecomment-1356481595", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1843", "id": 1356481595, "node_id": "IC_kwDOBm6k_c5Q2kQ7", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-17T22:02:40Z", "updated_at": "2022-12-17T22:02:40Z", "author_association": "OWNER", "body": "This is interesting:\r\n\r\n```python\r\nimport resource\r\nprint(resource.getrlimit(resource.RLIMIT_NOFILE))\r\n```\r\nOn Mac:\r\n```pycon\r\n>>> print(resource.getrlimit(resource.RLIMIT_NOFILE))\r\n(256, 9223372036854775807)\r\n```\r\nOn Ubuntu (in a Docker `ubuntu:22.04` container):\r\n```pycon\r\n>>> resource.getrlimit(resource.RLIMIT_NOFILE)\r\n(1048576, 1048576)\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1408757705, "label": "Intermittent \"Too many open files\" error running tests"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1955#issuecomment-1356487139", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1955", "id": 1356487139, "node_id": "IC_kwDOBm6k_c5Q2lnj", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-17T22:16:52Z", "updated_at": "2022-12-17T22:16:52Z", "author_association": "OWNER", "body": "I'm trying this fix again, after a bunch of work on the test suite in:\r\n- #1959", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1496652622, "label": "invoke_startup() is not run in some conditions, e.g. gunicorn/uvicorn workers, breaking lots of things"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1955#issuecomment-1356489200", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1955", "id": 1356489200, "node_id": "IC_kwDOBm6k_c5Q2mHw", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-17T22:29:51Z", "updated_at": "2022-12-17T22:29:51Z", "author_association": "OWNER", "body": "No, it still causes the tests to hang (I let them run for 12 minutes):\r\n\r\n\"image\"\r\n\r\nInteresting that the regular tests passed an then the `pytest -m serial` ones seem to have failed.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1496652622, "label": "invoke_startup() is not run in some conditions, e.g. gunicorn/uvicorn workers, breaking lots of things"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1959#issuecomment-1356478792", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1959", "id": 1356478792, "node_id": "IC_kwDOBm6k_c5Q2jlI", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-17T21:49:36Z", "updated_at": "2022-12-17T21:49:36Z", "author_association": "OWNER", "body": "Made a really good start on this in the just-merged PR:\r\n- #1960\r\n\r\nThe follow-up work will happen in:\r\n- #1962", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1499081664, "label": "Refactor test suite to use mostly `async def` tests"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1960#issuecomment-1354062939", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1960", "id": 1354062939, "node_id": "IC_kwDOBm6k_c5QtVxb", "user": {"value": 22429695, "label": "codecov[bot]"}, "created_at": "2022-12-16T01:48:06Z", "updated_at": "2022-12-17T21:40:43Z", "author_association": "NONE", "body": "# [Codecov](https://codecov.io/gh/simonw/datasette/pull/1960?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) Report\nBase: **92.19**% // Head: **92.05**% // Decreases project coverage by **`-0.13%`** :warning:\n> Coverage data is based on head [(`770879a`)](https://codecov.io/gh/simonw/datasette/pull/1960?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) compared to base [(`0b68996`)](https://codecov.io/gh/simonw/datasette/commit/0b68996cc511b3a801f0cd0157bd66332d75f46f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison).\n> Patch coverage: 100.00% of modified lines in pull request are covered.\n\n> :exclamation: Current head 770879a differs from pull request most recent head f42bca8. Consider uploading reports for the commit f42bca8 to get more accurate results\n\n
Additional details and impacted files\n\n\n```diff\n@@ Coverage Diff @@\n## main #1960 +/- ##\n==========================================\n- Coverage 92.19% 92.05% -0.14% \n==========================================\n Files 38 38 \n Lines 5521 5527 +6 \n==========================================\n- Hits 5090 5088 -2 \n- Misses 431 439 +8 \n```\n\n\n| [Impacted Files](https://codecov.io/gh/simonw/datasette/pull/1960?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) | Coverage \u0394 | |\n|---|---|---|\n| [datasette/app.py](https://codecov.io/gh/simonw/datasette/pull/1960/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison#diff-ZGF0YXNldHRlL2FwcC5weQ==) | `94.13% <100.00%> (-0.57%)` | :arrow_down: |\n| [datasette/utils/testing.py](https://codecov.io/gh/simonw/datasette/pull/1960/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison#diff-ZGF0YXNldHRlL3V0aWxzL3Rlc3RpbmcucHk=) | `95.83% <100.00%> (+0.24%)` | :arrow_up: |\n| [datasette/views/index.py](https://codecov.io/gh/simonw/datasette/pull/1960/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison#diff-ZGF0YXNldHRlL3ZpZXdzL2luZGV4LnB5) | `96.49% <0.00%> (-1.76%)` | :arrow_down: |\n| [datasette/database.py](https://codecov.io/gh/simonw/datasette/pull/1960/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison#diff-ZGF0YXNldHRlL2RhdGFiYXNlLnB5) | `94.57% <0.00%> (-0.61%)` | :arrow_down: |\n\nHelp us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison)\n\n
\n\n[:umbrella: View full report at Codecov](https://codecov.io/gh/simonw/datasette/pull/1960?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison). \n:loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison).\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1499150951, "label": "Port as many tests as possible to async def tests against ds_client"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1960#issuecomment-1356038242", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1960", "id": 1356038242, "node_id": "IC_kwDOBm6k_c5Q04Bi", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-17T04:56:22Z", "updated_at": "2022-12-17T04:57:04Z", "author_association": "OWNER", "body": "May have spotted the problem with that `test_paginate_tables_and_views` test:\r\n\r\n```\r\n(Pdb) path, expected_rows, expected_pages\r\n(None, 201, 9)\r\n```\r\n`path` should not be `None` here:\r\n\r\nhttps://github.com/simonw/datasette/blob/cede1efeedbc3d928397d53d5a1611eecc598fde/tests/test_table_api.py#L175-L212\r\n\r\nNo that's not it either - `path` is reassigned on purpose.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1499150951, "label": "Port as many tests as possible to async def tests against ds_client"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1960#issuecomment-1356056018", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1960", "id": 1356056018, "node_id": "IC_kwDOBm6k_c5Q08XS", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-17T05:33:26Z", "updated_at": "2022-12-17T05:33:26Z", "author_association": "OWNER", "body": "I think I've found the problem. The failing test is this one:\r\n\r\n`paginated_view.json-201-9`\r\n\r\nThat's this example:\r\n\r\nhttps://github.com/simonw/datasette/blob/cede1efeedbc3d928397d53d5a1611eecc598fde/tests/test_table_api.py#L179-L180\r\n\r\nWhy is it expected to take 9 pages and not 5, when the definition of that view is this:\r\n\r\n```sql\r\nCREATE VIEW paginated_view AS\r\n SELECT\r\n content,\r\n '- ' || content || ' -' AS content_extra\r\n FROM no_primary_key;\r\n```\r\nBecause `paginated_view` has extra configuration in `metadata.json`:\r\n\r\nhttps://github.com/simonw/datasette/blob/5ee954e34b6eb762ccecbdb2be0791d0166fd19c/tests/fixtures.py#L357\r\n\r\nSo this test is showing that `metadata` can be used to set an alternative page size for a view.\r\n\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1499150951, "label": "Port as many tests as possible to async def tests against ds_client"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1960#issuecomment-1356476583", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1960", "id": 1356476583, "node_id": "IC_kwDOBm6k_c5Q2jCn", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-17T21:34:51Z", "updated_at": "2022-12-17T21:34:51Z", "author_association": "OWNER", "body": "These are all the places that tests touch `_metadata_local` at the moment:\r\n```\r\n(venv) root@76a81d2417f5:/tmp/datasette/tests# rg _metadata_local \r\ntest_facets.py\r\n596: ds._metadata_local = {\r\n605: ds._metadata_local[\"databases\"][\"test_facet_size\"][\"tables\"][\"neighbourhoods\"][\r\n\r\ntest_permissions.py\r\n62: padlock_client.ds._metadata_local[\"allow\"] = allow\r\n77: del padlock_client.ds._metadata_local[\"allow\"]\r\n522: cascade_app_client.ds._metadata_local = updated_metadata\r\n533: cascade_app_client.ds._metadata_local = previous_metadata\r\n549: previous_metadata = cascade_app_client.ds._metadata_local\r\n551: cascade_app_client.ds._metadata_local = metadata\r\n566: cascade_app_client.ds._metadata_local = previous_metadata\r\n842: perms_ds._metadata_local = updated_metadata\r\n849: perms_ds._metadata_local = previous_metadata\r\n\r\ntest_html.py\r\n1114: orig = ds_client.ds._metadata_local\r\n1115: ds_client.ds._metadata_local = metadata\r\n1123: ds_client.ds._metadata_local = orig\r\n\r\ntest_plugins.py\r\n1034: ds_client.ds._metadata_local = {\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1499150951, "label": "Port as many tests as possible to async def tests against ds_client"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1960#issuecomment-1356476886", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1960", "id": 1356476886, "node_id": "IC_kwDOBm6k_c5Q2jHW", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-17T21:37:05Z", "updated_at": "2022-12-17T21:37:05Z", "author_association": "OWNER", "body": "I think this test may be to blame:\r\n\r\nhttps://github.com/simonw/datasette/blob/5ee954e34b6eb762ccecbdb2be0791d0166fd19c/tests/test_plugins.py#L950-L972\r\n\r\nIt's over-riding `_metadata_local` and then failing to set it back to original in a `finally:` block at the end.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1499150951, "label": "Port as many tests as possible to async def tests against ds_client"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1960#issuecomment-1356478575", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1960", "id": 1356478575, "node_id": "IC_kwDOBm6k_c5Q2jhv", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-17T21:47:48Z", "updated_at": "2022-12-17T21:47:48Z", "author_association": "OWNER", "body": "Stick a twig in it, this will do for the moment.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1499150951, "label": "Port as many tests as possible to async def tests against ds_client"}, "performed_via_github_app": null}