Skip to content
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

Look at flaky tests and make them deterministic #1647

Closed
MattDelac opened this issue Jun 15, 2021 · 1 comment
Closed

Look at flaky tests and make them deterministic #1647

MattDelac opened this issue Jun 15, 2021 · 1 comment
Labels
priority/p0 Highest priority

Comments

@MattDelac
Copy link
Collaborator

Expected Behavior

Ideally, all the tests should be deterministic

Current Behavior

Some tests are currently flaky which makes the development experience more painful that it could be
image

Steps to reproduce

Run integration tests and some of them might fail (don't know the frequency of the problem)

Specifications

  • Version:
  • Platform:
  • Subsystem:

Possible Solution

@woop woop added the priority/p0 Highest priority label Jun 16, 2021
@felixwang9817
Copy link
Collaborator

felixwang9817 commented Jul 15, 2021

Flaky integration tests are caused by concurrency issues between three Python processes running the same test, which happens when an integration test creates a BigQuery table with a specific name without sufficient randomization (e.g. appending time.time_ns()). Importantly, appending time.time() is not sufficient; tests should use time.time_ns() and random.randint(1000, 9999).

This PR gives an example of this kind of mistake and the appropriate fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/p0 Highest priority
Projects
None yet
Development

No branches or pull requests

3 participants