New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test workers #1995
Test workers #1995
Commits on Jun 4, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 1fa3846 - Browse repository at this point
Copy the full SHA 1fa3846View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4b8923d - Browse repository at this point
Copy the full SHA 4b8923dView commit details -
Update coverage configuration for subprocesses
- Enable the required parallel mode - Set the required `COVERAGE_PROCESS_START` environment variable - Add `coverage_enable_subprocess` for `coverage.process_startup` - Combine coverage reports before reporting coverage - Update `.gitignore` to ignore files named `.coverage*` https://coverage.readthedocs.io/en/latest/subprocess.html
Configuration menu - View commit details
-
Copy full SHA for 0844cf3 - Browse repository at this point
Copy the full SHA 0844cf3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 65a16c7 - Browse repository at this point
Copy the full SHA 65a16c7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1be545c - Browse repository at this point
Copy the full SHA 1be545cView commit details -
Handle flaky signals in Gunicorn worker tests
Occasional flakes are seen with some less-common signals. This commit will add some simple conditionals to avoid `AssertionError` exceptions when those signals are not handled as expected.
Configuration menu - View commit details
-
Copy full SHA for ab4a73c - Browse repository at this point
Copy the full SHA ab4a73cView commit details -
Disable flaking file reloader tests
`WatchFilesReload` flakes when used with coverage.py parallel mode. It may have to do with the threading in the `touch_soon` fixture. Other WatchGod and Watchfiles flake on Windows specifically. Errors: ```text ================================== FAILURES =================================== ___________ TestBaseReload.test_override_defaults[WatchFilesReload] ___________ self = <test_reload.TestBaseReload object at 0x0000014D4AB94160> touch_soon = <function touch_soon.<locals>.start at 0x0000014D4C3192D0> @pytest.mark.parametrize("reloader_class", [WatchFilesReload, WatchGodReload]) def test_override_defaults(self, touch_soon) -> None: dotted_file = self.reload_path / ".dotted" dotted_dir_file = self.reload_path / ".dotted_dir" / "file.txt" python_file = self.reload_path / "main.py" with as_cwd(self.reload_path): config = Config( app="tests.test_config:asgi_app", reload=True, # We need to add *.txt otherwise no regular files will match reload_includes=[".*", "*.txt"], reload_excludes=["*.py"], ) reloader = self._setup_reloader(config) assert self._reload_tester(touch_soon, reloader, dotted_file) assert self._reload_tester(touch_soon, reloader, dotted_dir_file) > assert not self._reload_tester(touch_soon, reloader, python_file) E AssertionError: assert not [WindowsPath('C:/Users/runneradmin/AppData/Local/Temp/pytest-of-runneradmin/pytest-0/reload_directory1/.coverage.fv-az811-309.2664.795750')] E + where [WindowsPath('C:/Users/runneradmin/AppData/Local/Temp/pytest-of-runneradmin/pytest-0/reload_directory1/.coverage.fv-az811-309.2664.795750')] = <bound method TestBaseReload._reload_tester of <test_reload.TestBaseReload object at 0x0000014D4AB94160>>(<function touch_soon.<locals>.start at 0x0000014D4C3192D0>, <uvicorn.supervisors.watchfilesreload.WatchFilesReload object at 0x0000014D4C39DEA0>, WindowsPath('C:/Users/runneradmin/AppData/Local/Temp/pytest-of-runneradmin/pytest-0/reload_directory1/main.py')) E + where <bound method TestBaseReload._reload_tester of <test_reload.TestBaseReload object at 0x0000014D4AB94160>> = <test_reload.TestBaseReload object at 0x0000014D4AB94160>._reload_tester tests\supervisors\test_reload.py:253: AssertionError ---------------------------- Captured stderr call ----------------------------- INFO: Will watch for changes in these directories: ['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\reload_directory1'] INFO: Started reloader process [6280] using WatchFiles ------------------------------ Captured log call ------------------------------ INFO uvicorn.error:config.py:345 Will watch for changes in these directories: ['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\reload_directory1'] INFO uvicorn.error:basereload.py:77 Started reloader process [6280] using WatchFiles ____________ TestBaseReload.test_override_defaults[WatchGodReload] ____________ self = <test_reload.TestBaseReload object at 0x0000014D4AB959F0> touch_soon = <function touch_soon.<locals>.start at 0x0000014D4C3E77F0> @pytest.mark.parametrize("reloader_class", [WatchFilesReload, WatchGodReload]) def test_override_defaults(self, touch_soon) -> None: dotted_file = self.reload_path / ".dotted" dotted_dir_file = self.reload_path / ".dotted_dir" / "file.txt" python_file = self.reload_path / "main.py" with as_cwd(self.reload_path): config = Config( app="tests.test_config:asgi_app", reload=True, # We need to add *.txt otherwise no regular files will match reload_includes=[".*", "*.txt"], reload_excludes=["*.py"], ) reloader = self._setup_reloader(config) assert self._reload_tester(touch_soon, reloader, dotted_file) > assert self._reload_tester(touch_soon, reloader, dotted_dir_file) tests\supervisors\test_reload.py:252: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <test_reload.TestBaseReload object at 0x0000014D4AB959F0> touch_soon = <function touch_soon.<locals>.start at 0x0000014D4C3E77F0> reloader = <uvicorn.supervisors.watchgodreload.WatchGodReload object at 0x0000014D4C39DAB0> files = (WindowsPath('C:/Users/runneradmin/AppData/Local/Temp/pytest-of-runneradmin/pytest-0/reload_directory1/.dotted_dir/file.txt'),) @py_assert2 = [WindowsPath('C:/Users/runneradmin/AppData/Local/Temp/pytest-of-runneradmin/pytest-0/reload_directory1/.coverage.fv-az...s/runneradmin/AppData/Local/Temp/pytest-of-runneradmin/pytest-0/reload_directory1/.coverage.fv-az811-309.4856.060689')] @py_assert4 = False @py_format5 = "assert not [WindowsPath('C:/Users/runneradmin/AppData/Local/Temp/pytest-of-runneradmin/pytest-0/reload_directory1/.co...v-az811-309.4856.060689')] = next(<uvicorn.supervisors.watchgodreload.WatchGodReload object at 0x0000014D4C39DAB0>)\n}" def _reload_tester( self, touch_soon, reloader: BaseReload, *files: Path ) -> Optional[List[Path]]: reloader.restart() if WatchFilesReload is not None and isinstance(reloader, WatchFilesReload): touch_soon(*files) else: > assert not next(reloader) E AssertionError: assert not [WindowsPath('C:/Users/runneradmin/AppData/Local/Temp/pytest-of-runneradmin/pytest-0/reload_directory1/.coverage.fv-az...s/runneradmin/AppData/Local/Temp/pytest-of-runneradmin/pytest-0/reload_directory1/.coverage.fv-az811-309.4856.060689')] E + where [WindowsPath('C:/Users/runneradmin/AppData/Local/Temp/pytest-of-runneradmin/pytest-0/reload_directory1/.coverage.fv-az...s/runneradmin/AppData/Local/Temp/pytest-of-runneradmin/pytest-0/reload_directory1/.coverage.fv-az811-309.4856.060689')] = next(<uvicorn.supervisors.watchgodreload.WatchGodReload object at 0x0000014D4C39DAB0>) tests\supervisors\test_reload.py:63: AssertionError ---------------------------- Captured stderr call ----------------------------- INFO: Will watch for changes in these directories: ['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\reload_directory1'] INFO: Started reloader process [6280] using WatchGod ------------------------------ Captured log call ------------------------------ INFO uvicorn.error:config.py:345 Will watch for changes in these directories: ['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\reload_directory1'] INFO uvicorn.error:basereload.py:77 Started reloader process [6280] using WatchGod ```
Configuration menu - View commit details
-
Copy full SHA for 210f382 - Browse repository at this point
Copy the full SHA 210f382View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1ab8202 - Browse repository at this point
Copy the full SHA 1ab8202View commit details -
Configuration menu - View commit details
-
Copy full SHA for dda05fc - Browse repository at this point
Copy the full SHA dda05fcView commit details -
Disable GitHub Actions
fail-fast
The GitHub Actions `jobs.<job_id>.strategy.fail-fast` setting controls how failures are handled. The default of `true` will fail the entire job when any job in the matrix fails. With the introduction of platform-specific worker testing, subprocesses, and operating system signal handling, there is potential for specific workflow jobs to occasionally fail. In these cases, it can help to set `fail-fast: false` to ensure that those specific failed jobs can be identified. https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
Configuration menu - View commit details
-
Copy full SHA for 1d472e2 - Browse repository at this point
Copy the full SHA 1d472e2View commit details -
Add GitHub Actions timeout for tests
With the introduction of platform-specific worker testing, subprocesses, and operating system signal handling, there is potential for specific workflow jobs to occasionally hang. In these cases, it can help to set a timeout on the test step to ensure the workflow jobs don't hang until the default 360 minute (6 hour) timeout. https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
Configuration menu - View commit details
-
Copy full SHA for fa7814c - Browse repository at this point
Copy the full SHA fa7814cView commit details -
- Explain how to skip subprocess tests by using the custom pytest marker - Explain how to re-run failed GitHub Actions jobs
Configuration menu - View commit details
-
Copy full SHA for 0624d57 - Browse repository at this point
Copy the full SHA 0624d57View commit details -
Configuration menu - View commit details
-
Copy full SHA for 68dc870 - Browse repository at this point
Copy the full SHA 68dc870View commit details -
Configuration menu - View commit details
-
Copy full SHA for cf737cc - Browse repository at this point
Copy the full SHA cf737ccView commit details
Commits on Jun 6, 2023
-
Revert "Disable GitHub Actions
fail-fast
"This reverts commit 1d472e2.
Configuration menu - View commit details
-
Copy full SHA for b1ab28c - Browse repository at this point
Copy the full SHA b1ab28cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9d4365a - Browse repository at this point
Copy the full SHA 9d4365aView commit details
Commits on Jun 7, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 3add98c - Browse repository at this point
Copy the full SHA 3add98cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1bc61dd - Browse repository at this point
Copy the full SHA 1bc61ddView commit details
Commits on Jun 16, 2023
-
Merge branch 'master' into test-workers
Conflicts: pyproject.toml requirements.txt
Configuration menu - View commit details
-
Copy full SHA for 23adbdf - Browse repository at this point
Copy the full SHA 23adbdfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4923963 - Browse repository at this point
Copy the full SHA 4923963View commit details