-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix streaming initial response for windows clients #3347
Conversation
tests/aws-cpp-sdk-bedrock-runtime-integration-tests/IntegrationTests.cpp
Show resolved
Hide resolved
{ | ||
if (::testing::Test::HasFailure()) | ||
{ | ||
std::cout << "Test traces: " << testTrace << "\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont use std::cout
use a AWS_LOG
macro or google test assertion. additionally where is testTrace
updated? can this be remove entirely? i sont see this string updated anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pattern I used in the transcribe streaming tests where I wanted to keep test debug traces, but don't pollute output in case of success.
Likely to be a copy error from the test used as a template, and likely to be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall remove the debug messages
streamHandler->SetInitialResponseCallbackEx([&](const Aws::BedrockRuntime::Model::ConverseStreamInitialResponse& , const Aws::Utils::Event::InitialResponseType awsResponseType) | ||
{ | ||
std::unique_lock<std::mutex> lock(mutex); | ||
cv.wait(lock, [&] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never use wait
in tests, always use wait_for
or wait_until with reasonable timeouts. we have had too many instances of tests deadlocking on CI servers
additionally do want to wait here? seems like we actually arent waiting as this will never be woken up if the condition is not true the first time. seems like more so we just want to assert that awsResponseType
is ON_RESPONSE
and the mutex will handle the synchronized update of responseReceived
with no wait needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have simplified it in the next commit.
@@ -0,0 +1,36 @@ | |||
add_project(aws-cpp-sdk-bedrock-runtime-integration-tests | |||
"Tests for Bedrock Runtime C++ SDK" | |||
#aws-cpp-sdk-access-management |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented out dep on access-management
c720ed7
to
c11cac0
Compare
m_client = Aws::MakeShared<BedrockRuntimeClient>(ALLOCATION_TAG, config); | ||
} | ||
|
||
void TearDown() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should remove TearDown
if its a empty function
Issue #, if available:
Fix initial response handling for windows http client
Description of changes:
Check all that applies:
Check which platforms you have built SDK on to verify the correctness of this PR.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.