{"html_url": "https://github.com/simonw/datasette/pull/1960#issuecomment-1355319541", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1960", "id": 1355319541, "node_id": "IC_kwDOBm6k_c5QyIj1", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-16T17:58:24Z", "updated_at": "2022-12-16T17:58:46Z", "author_association": "OWNER", "body": "> I tried adding `invoke_startup()` to the `ds_client()` fixture to see if that would fix this.\r\n\r\nIt did not: I'm still seeing those same failures. Frustrating: https://github.com/simonw/datasette/actions/runs/3715317653/jobs/6300336884\r\n\r\n ====== 11 failed, 1252 passed, 1 skipped, 1 warning in 185.77s (0:03:05) =======", "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-1355478743", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1960", "id": 1355478743, "node_id": "IC_kwDOBm6k_c5QyvbX", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-16T19:27:12Z", "updated_at": "2022-12-16T19:27:12Z", "author_association": "OWNER", "body": "Bad news: they're definitely caused by tests that are subtly affected by other tests.\r\n\r\nThis passes without errors:\r\n\r\n pytest -k test_paginate_tables_and_views", "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-1355313058", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1960", "id": 1355313058, "node_id": "IC_kwDOBm6k_c5QyG-i", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-16T17:53:17Z", "updated_at": "2022-12-16T17:53:17Z", "author_association": "OWNER", "body": "Got some surprising test failures here: https://github.com/simonw/datasette/actions/runs/3715317653/jobs/6300336626\r\n```\r\n> assert response.json() == [{\"id\": 1, \"name\": \"San Francisco\"}]\r\nE AssertionError: assert {'error': 'Ta...'title': None} == [{'id': 1, 'n...n Francisco'}]\r\nE Full diff:\r\nE - [{'id': 1, 'name': 'San Francisco'}]\r\nE + {'error': 'Table not found: \ud835\udc1c\ud835\udc22\ud835\udc2d\ud835\udc22\ud835\udc1e\ud835\udc2c', 'ok': False, 'status': 404, 'title': None}\r\n```\r\nA hunch: this failure suggests that maybe the fixtures tables were not correctly created when this test run. Maybe that can happen when `python -n auto` runs a bunch of separate processes and hence one of the tests randomly gets run in a fresh process and executes before the in-memory fixtures database has been fully populated.\r\n\r\nI tried adding `invoke_startup()` to the `ds_client()` fixture to see if that would fix this.", "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-1354148139", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1960", "id": 1354148139, "node_id": "IC_kwDOBm6k_c5Qtqkr", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-16T03:32:52Z", "updated_at": "2022-12-16T03:32:52Z", "author_association": "OWNER", "body": "Got that done to: 68 passed in 14.92s\r\n\r\nBy implementing my own global variable - since `pytest` won't use a global fixture for me, I decided to do it for myself.", "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-1355475671", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1960", "id": 1355475671, "node_id": "IC_kwDOBm6k_c5QyurX", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-16T19:26:08Z", "updated_at": "2022-12-16T19:26:08Z", "author_association": "OWNER", "body": "Great news! The test failures I got running on my laptop (with that fresh Ubuntu Docker image) look like they match the failures I saw in CI:\r\n\r\n```\r\n======== short test summary info ========\r\nFAILED tests/test_table_api.py::test_paginate_tables_and_views[/fixtures/paginated_view.json-201-9] - assert 9 == 5\r\nFAILED tests/test_table_api.py::test_sortable_columns_metadata - KeyError: 'error'\r\nFAILED tests/test_table_api.py::test_searchable_views[/fixtures/searchable_view_configured_by_metadata.json?_search=weasel-expected_rows0] - AssertionError: assert [[2, 'terry d...sel', 'puma']] == [[1, 'barry c...sel', 'puma']]\r\nFAILED tests/test_table_api.py::test_unit_filters - KeyError: 'distance'\r\nFAILED tests/test_table_api.py::test_custom_query_with_unicode_characters - AssertionError: assert {'error': 'Ta...'title': None} == [{'id': 1, 'n...n Francisco'}]\r\nFAILED tests/test_table_html.py::test_sort_links - AssertionError: assert [{'a_href': N...', ...}}, ...] == [{'a_href': N...', ...}}, ...]\r\nFAILED tests/test_table_html.py::test_table_html_no_primary_key - AttributeError: 'NoneType' object has no attribute 'strip'\r\nFAILED tests/test_table_html.py::test_table_html_foreign_key_custom_label_column - assert [['