Skip to content

[Bug]: make test_openai_schema.py pass, enable it in CI #18162

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

Closed
1 task done
davidxia opened this issue May 14, 2025 · 0 comments · Fixed by #18224
Closed
1 task done

[Bug]: make test_openai_schema.py pass, enable it in CI #18162

davidxia opened this issue May 14, 2025 · 0 comments · Fixed by #18224
Labels
bug Something isn't working

Comments

@davidxia
Copy link
Contributor

davidxia commented May 14, 2025

This is a follow up to PR #17664 and issues like #17037 and #17038.

As of the time of this writing, the only sub-test in tests/entrypoints/openai/test_openai_schema.py that consistently fails is POST /tokenize caused by

raise NotImplementedError(f"Unknown part type: {part_type}")
when part_type is "file". The expected response is 200 as documented by the OpenAPI spec.

How should we make this test pass? This is a requirement to eventually enabling the test in CI by removing --ignore=entrypoints/openai/test_openai_schema.py in test-pipeline.yaml.

============================================================================================ FAILURES =============================================================================================
_____________________________________________________________________ test_openapi_stateless (verbose_name='POST /tokenize') ______________________________________________________________________

    @wraps(test)
>   def test_function(*args: Any, **kwargs: Any) -> Any:

.venv/lib/python3.12/site-packages/schemathesis/_hypothesis.py:83: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

case = Case(body={'messages': [{'content': [{'file': {}, 'type': 'file'}], 'role': 'user'}]})

    @schema.parametrize(tag="debug")
    @schema.override(headers={"Content-Type": "application/json"})
    def test_openapi_stateless(case: schemathesis.Case):
        key = (
            case.operation.method.upper(),
            case.operation.path,
        )
        timeout = {
            ("POST", "/v1/chat/completions"): 99999,
        }.get(key, 10)
    
        #No need to verify SSL certificate for localhost
>       case.call_and_validate(verify=False, timeout=timeout)
E       schemathesis.exceptions.CheckFailed: 
E       
E       1. Server error
E       
E       [500] Internal Server Error:
E       
E           `{"object":"error","message":"Unknown part type: file","type":"Internal Server Error","param":null,"code":500}`
E       
E       Reproduce with: 
E       
E           curl -X POST -H 'Content-Type: application/json' -d '{"messages": [{"content": [{"file": {}, "type": "file"}], "role": "user"}]}' --insecure http://localhost:48767/tokenize
E       
E       Falsifying example: test_openapi_stateless(
E           case=,
E       )

tests/entrypoints/openai/test_openai_schema.py:57: CheckFailed
$ curl -X POST -H 'Content-Type: application/json' -d '{"messages": [{"content": [{"file": {}, "type": "file"}], "role": "user"}]}' --insecure http://localhost:8000/tokenize -v
Note: Unnecessary use of -X or --request, POST is already inferred.
* Host localhost:8000 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:8000...
* connect to ::1 port 8000 from ::1 port 40420 failed: Connection refused
*   Trying 127.0.0.1:8000...
* Connected to localhost (127.0.0.1) port 8000
> POST /tokenize HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/8.5.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 75
> 
< HTTP/1.1 500 Internal Server Error
< date: Mon, 12 May 2025 17:32:11 GMT
< server: uvicorn
< content-length: 109
< content-type: application/json
< 
* Connection #0 to host localhost left intact
{"object":"error","message":"Unknown part type: file","type":"Internal Server Error","param":null,"code":500}

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.
@davidxia davidxia added the bug Something isn't working label May 14, 2025
davidxia added a commit to davidxia/vllm that referenced this issue May 15, 2025
by filtering out test cases to `POST /tokenize` endpoint
that are known to fail with a reply of HTTP 501 Not Implemented.

Enable the test in CI.

FIX vllm-project#18162

Signed-off-by: David Xia <[email protected]>
davidxia added a commit to davidxia/vllm that referenced this issue May 16, 2025
by filtering out test cases to `POST /tokenize` endpoint
that are known to fail with a reply of HTTP 501 Not Implemented.

Enable the test in CI.

FIX vllm-project#18162

Signed-off-by: David Xia <[email protected]>
davidxia added a commit to davidxia/vllm that referenced this issue May 16, 2025
by filtering out test cases to `POST /tokenize` endpoint
that are known to fail with a reply of HTTP 501 Not Implemented.

Enable the test in CI.

FIX vllm-project#18162

Signed-off-by: David Xia <[email protected]>
davidxia added a commit to davidxia/vllm that referenced this issue May 20, 2025
by filtering out test cases to `POST /tokenize` endpoint
that are known to fail with a reply of HTTP 501 Not Implemented.

Enable the test in CI.

FIX vllm-project#18162

Signed-off-by: David Xia <[email protected]>
davidxia added a commit to davidxia/vllm that referenced this issue May 22, 2025
by filtering out test cases to `POST /tokenize` endpoint
that are known to fail with a reply of HTTP 501 Not Implemented.

Enable the test in CI.

FIX vllm-project#18162

Signed-off-by: David Xia <[email protected]>
davidxia added a commit to davidxia/vllm that referenced this issue May 22, 2025
by filtering out test cases to `POST /tokenize` endpoint
that are known to fail with a reply of HTTP 501 Not Implemented.

Enable the test in CI.

FIX vllm-project#18162

Signed-off-by: David Xia <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant