Skip to content

Conversation

@mccoyp
Copy link
Member

@mccoyp mccoyp commented May 16, 2024

Description

Libraries independently have set up their own solutions to disable time.sleep/asyncio.sleep in playback, since waiting for polling operations is unnecessary in this scenario and can make tests take much longer than they otherwise would. A Dev Center PR made me realize that we never had central documentation of this convention, meaning that new libraries would likely miss out on this.

This PR attempts to add sleep-skipping fixtures to our repository's central conftest.py, meaning that everyone would be opted in to the patch by default. These fixtures are skipped if azure-sdk-tools isn't installed (e.g. for tests in azure-storage-extensions, which are entirely unit tests and don't require the library). Local testing confirms that this try/except is compatible with pytest fixtures and things work as expected.

The only problem with the central approach is that I'm not sure how someone could opt out of this behavior. Adding a pytest command flag might work, but this would need to be manually added whenever pytest is run and wouldn't be very compatible with test-running environments that we have set up, like tox.

Core CI run: https://dev.azure.com/azure-sdk/public/_build/results?buildId=3795586&view=results

cc @scbedd

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@mccoyp
Copy link
Member Author

mccoyp commented May 16, 2024

/azp run python - core - ci

@azure-pipelines
Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@mccoyp mccoyp closed this May 16, 2024
@mccoyp mccoyp deleted the central-sleep-patch branch May 16, 2024 22:10
@mccoyp mccoyp mentioned this pull request May 16, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant