Skip to content

Commit

Permalink
Revert changes to integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nkaretnikov committed Mar 15, 2024
1 parent 4ca67a6 commit c25c0ca
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,15 +641,10 @@ def get_logs():
assert quartiles[0] < threshold


# This used to fail with build_key_version < 3. With v3, the sizes of namespace
# and environment names have no effect on the build key, so the build should
# complete without failures. The comments below describe errors that used to
# happen previously:
#
# > Only testing size values that will always cause errors. Smaller values could
# > cause errors as well, but would be flaky since the test conda-store state
# > directory might have different lengths on different systems, for instance,
# > due to different username lengths.
# Only testing size values that will always cause errors. Smaller values could
# cause errors as well, but would be flaky since the test conda-store state
# directory might have different lengths on different systems, for instance,
# due to different username lengths.
@pytest.mark.parametrize(
"size",
[
Expand All @@ -674,7 +669,7 @@ def test_create_specification_auth_env_name_too_long(testclient, size):
"specification": json.dumps({"name": environment_name}),
},
)
if size > 255: # SQL error, expected
if size > 255:
assert response.status_code == 500
return # error, nothing to do
response.raise_for_status()
Expand All @@ -683,7 +678,7 @@ def test_create_specification_auth_env_name_too_long(testclient, size):
assert r.status == schema.APIStatus.OK
build_id = r.data.build_id

# Try checking that the status is 'COMPLETED'
# Try checking that the status is 'FAILED'
is_updated = False
for _ in range(60):
time.sleep(10)
Expand All @@ -695,9 +690,10 @@ def test_create_specification_auth_env_name_too_long(testclient, size):
r = schema.APIGetBuild.parse_obj(response.json())
assert r.status == schema.APIStatus.OK
assert r.data.specification.name == environment_name
if r.data.status in ("QUEUED", "BUILDING"):
if r.data.status == "QUEUED":
continue # checked too fast, try again
assert r.data.status == "COMPLETED"
assert r.data.status == "FAILED"
assert r.data.status_info == "build_path too long: must be <= 255 characters"
is_updated = True
break

Expand Down

0 comments on commit c25c0ca

Please sign in to comment.