Skip to content

Commit

Permalink
[WB-8309] Address test flakiness on Windows (#3198)
Browse files Browse the repository at this point in the history
* fix test flakiness on windows

(cherry picked from commit 67b8208)
  • Loading branch information
dmitryduev authored and raubitsj committed Jan 31, 2022
1 parent 1c18d9c commit 66578b7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
38 changes: 20 additions & 18 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,39 +166,41 @@ def disable_git_save():
@pytest.fixture
def git_repo(runner):
with runner.isolated_filesystem():
r = git.Repo.init(".")
mkdir_exists_ok("wandb")
# Because the forked process doesn't use my monkey patch above
with open("wandb/settings", "w") as f:
f.write("[default]\nproject: test")
open("README", "wb").close()
r.index.add(["README"])
r.index.commit("Initial commit")
yield GitRepo(lazy=False)
with git.Repo.init(".") as repo:
mkdir_exists_ok("wandb")
# Because the forked process doesn't use my monkey patch above
with open(os.path.join("wandb", "settings"), "w") as f:
f.write("[default]\nproject: test")
open("README", "wb").close()
repo.index.add(["README"])
repo.index.commit("Initial commit")
yield GitRepo(lazy=False)


@pytest.fixture
def git_repo_with_remote(runner):
with runner.isolated_filesystem():
r = git.Repo.init(".")
r.create_remote("origin", "https://foo:[email protected]/FooTest/Foo.git")
yield GitRepo(lazy=False)
with git.Repo.init(".") as repo:
repo.create_remote("origin", "https://foo:[email protected]/FooTest/Foo.git")
yield GitRepo(lazy=False)


@pytest.fixture
def git_repo_with_remote_and_port(runner):
with runner.isolated_filesystem():
r = git.Repo.init(".")
r.create_remote("origin", "https://foo:[email protected]:8080/FooTest/Foo.git")
yield GitRepo(lazy=False)
with git.Repo.init(".") as repo:
repo.create_remote(
"origin", "https://foo:[email protected]:8080/FooTest/Foo.git"
)
yield GitRepo(lazy=False)


@pytest.fixture
def git_repo_with_remote_and_empty_pass(runner):
with runner.isolated_filesystem():
r = git.Repo.init(".")
r.create_remote("origin", "https://foo:@github.com/FooTest/Foo.git")
yield GitRepo(lazy=False)
with git.Repo.init(".") as repo:
repo.create_remote("origin", "https://foo:@github.com/FooTest/Foo.git")
yield GitRepo(lazy=False)


@pytest.fixture
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ whitelist_externals =
bash
git
# Workaround for bug with fastparquet and numpy<0.20 ("numpy.ndarray size changed, may indicate binary incompatibility")
# fixme: fastparquet==0.8.0 fails locally, need to investigate
commands_pre =
py{36,37,38}: pip install fastparquet
py{36,37,38}: pip install "fastparquet<0.8"
commands =
mkdir -p test-results
py{35,36,37,38,39,310}: python -m pytest {env:CI_PYTEST_SPLIT_ARGS:} -n={env:CI_PYTEST_PARALLEL:4} --durations=20 --junitxml=test-results/junit.xml --cov-config=.coveragerc --cov --cov-report= --no-cov-on-fail {posargs:tests/}
Expand Down

0 comments on commit 66578b7

Please sign in to comment.