diff --git a/tests/test_api.py b/tests/test_api.py index 09b509782..9583249b1 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -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", [ @@ -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() @@ -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) @@ -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