Skip to content
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

Test Correlation Id string support for BLS #6963

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -88,9 +88,38 @@ def test_infer_request_args(self):
requested_output_names=requested_output_names,
inputs=inputs,
model_name=model_name,
correleation_id=None,
correlation_id=None,
)
pskiran1 marked this conversation as resolved.
Show resolved Hide resolved

# correlation_id set to an integer
infer_request_test = pb_utils.InferenceRequest(
requested_output_names=requested_output_names,
inputs=inputs,
model_name=model_name,
correlation_id=5,
)
self.assertIsInstance(infer_request_test.correlation_id(), int)
self.assertEqual(infer_request_test.correlation_id(), 5)

# correlation_id set to string
infer_request_test = pb_utils.InferenceRequest(
requested_output_names=requested_output_names,
inputs=inputs,
model_name=model_name,
correlation_id="test_str_id-5",
)
self.assertIsInstance(infer_request_test.correlation_id(), str)
self.assertEqual(infer_request_test.correlation_id(), "test_str_id-5")

# correlation_id default
infer_request_test = pb_utils.InferenceRequest(
requested_output_names=requested_output_names,
inputs=inputs,
model_name=model_name,
)
self.assertIsInstance(infer_request_test.correlation_id(), int)
self.assertEqual(infer_request_test.correlation_id(), 0)

# request_id set to None
with self.assertRaises(TypeError) as e:
pb_utils.InferenceRequest(
Expand Down
Loading