test: Safely handle filesystem exception#8736
Conversation
48a2328 to
9b03645
Compare
| ) | ||
| # TODO: [TRI-958] Status code 400 is more appropriate here | ||
| self.assertEqual( | ||
| 500, |
There was a problem hiding this comment.
but HTTP(400) is Bad Request while HTTP(500) is Internal Error.
I would think returning a 400 is more accurate.
There was a problem hiding this comment.
The status code is dropped here and any error is responded as 500 server error.
https://github.com/triton-inference-server/core/blob/45d5a3d92119b5f21a25aa290e9ee3d9b2641ba8/src/model_repository_manager/model_repository_manager.cc#L1347-L1351. That's why I added a TODO and created a ticket for fixing it.
There was a problem hiding this comment.
huh. 🤔 this is one of those clean up things we'll defer to a future PR then, thanks..
| long_path = "file:" + ("A" * 256) | ||
| payload = { | ||
| "parameters": { | ||
| long_path: "YQ==", |
There was a problem hiding this comment.
long_path: "YQ==",
What does this code do?
There was a problem hiding this comment.
Some random placeholder generated by AI. In practice, it's the binary data of custom model file.
What does the PR do?
Catch exceptions raised by
std::filesystem::canonicalandstd::filesystem::weakly_canonical.Checklist
<commit_type>: <Title>Commit Type:
Check the conventional commit type
box here and add the label to the github PR.
Related PRs:
triton-inference-server/client#887
triton-inference-server/core#491
Where should the reviewer start?
Test plan:
48465353
Caveats:
Background
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)