Skip to content

Fixing waitForDisconnect to (optionally) wait for disconnects#1232

Merged
mattklein123 merged 5 commits intoenvoyproxy:masterfrom
alyssawilk:flake
Jul 10, 2017
Merged

Fixing waitForDisconnect to (optionally) wait for disconnects#1232
mattklein123 merged 5 commits intoenvoyproxy:masterfrom
alyssawilk:flake

Conversation

@alyssawilk
Copy link
Contributor

Prior integration tests drained all data before calling waitForDisconnect(), so were not affected by the condition variable being triggered by any changes to the connection, not just disconnects.

An alternate fix is to change the first 3 tcp proxy integration tests to do what the 4th does and actively drain fake_rest_connection before calling waitForDisconnect(), so waitForDisconnect's wait() can't be triggered by onData. This would result in arguably cleaner tests, insofar as all data and events will always be accounted for, but leaves us with a confusingly named function and a requirement to do extra work even when it's not relevant to the system under test. That's a super easy change as well so let me know if you'd prefer I go that route and I'll comment up waitForDisconnect as best I can :-)

@mattklein123
Copy link
Member

I think @lizan opened this patch already a while ago and we decided not to merge it because at the time it was indicative of a test that was not written correctly. In this case, it seems like there is a real reason to do it this way? I'm fine going with this fix if it makes writing tests easier, but perhaps can you add a comment to waitForDisconnect() saying why we do the while loop and what type of testing that is useful for? cc @htuch

@alyssawilk
Copy link
Contributor Author

Sounds like there is some desire for that drain-by-default behavior. New patch - stick with the old default behavior, allow an easy override and comment heavily what's going on in both cases :-)

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome looks great, thanks. Small typo.

while (!disconnected_) {
connection_event_.wait(lock);
// The default behavior of waitForDisconnect is to assume the test cleanly
// calls waitForData, waitoforNewStream, etc. to handle all events on the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/waitoforNewStream/waitForNewStream

Copy link
Contributor

@dnoe dnoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alyssawilk alyssawilk changed the title Fixing waitForDisconnect to wait for disconnects Fixing waitForDisconnect to (optionally) wait for disconnects Jul 10, 2017
@mattklein123 mattklein123 merged commit 40d27a1 into envoyproxy:master Jul 10, 2017
alyssawilk added a commit to alyssawilk/envoy that referenced this pull request Jul 10, 2017
@alyssawilk alyssawilk deleted the flake branch July 20, 2017 14:58
mathetake pushed a commit that referenced this pull request Mar 3, 2026
**Description**

This updates to the latest openinference semantic conventions for
CreateEmbeddings requests, and re-records all spans. This also removes
the ModelO3Mini as OpenAI themselves recently removed it.

**Related Issues/PRs (if applicable)**

#1085

Signed-off-by: Adrian Cole <adrian@tetrate.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants