Add libswoc unit tests#11106
Merged
bneradt merged 5 commits intoapache:masterfrom Feb 29, 2024
Merged
Conversation
Adds libswoc unit_tests and updates the lib/swoc/CMakeLists.txt to build them.
ed356a4 to
782b1ca
Compare
782b1ca to
f3308be
Compare
Updating the unit_tests for newer compilers and to make the tests run more generally without assuming they were runned from a particular location.
f3308be to
524087b
Compare
Reverting back IntrusiveHashMap::insert ordering so that it puts things at the end of the list when there is a colision. Fix HttpSessionManager to walk the connection pool backwards.
524087b to
4ffc766
Compare
bneradt
commented
Feb 28, 2024
Comment on lines
+517
to
+525
| if (spot != limit) { | ||
| // If an equal key was found, walk past those to insert at the upper end of the range. | ||
| do { | ||
| spot = H::next_ptr(spot); | ||
| } while (spot != limit && H::equal(key, H::key_of(spot))); | ||
| if (spot != limit) { // something not equal past last equivalent, it's going to be mixed. | ||
| mixed_p = true; | ||
| } | ||
| } |
Contributor
Author
There was a problem hiding this comment.
This puts back what we reverted because origin side session pooling was broken by it. See #10992 where we pulled this out.
To address the functional concerns, see my patch below in HttpSessionManager.cc
bneradt
commented
Feb 28, 2024
| TextView::suffix_at(char c) const { | ||
| self_type zret; | ||
| if (auto n = this->rfind(c); n != npos) { | ||
| if (auto n = this->rfind(c); n != npos && n + 1 < this->size()) { |
Contributor
Author
There was a problem hiding this comment.
This addresses a compiler warning from Centos that zret.assign referenced the byte after data() if n pointed to the last byte in the string.
traeak
approved these changes
Feb 29, 2024
Contributor
traeak
left a comment
There was a problem hiding this comment.
These all look fine and the reverting of the IPRange and adjustments to HttpSessionManager look fine.
cmcfarlen
pushed a commit
that referenced
this pull request
Mar 1, 2024
Before this PR, we had pulled in libswoc's production source code into ATS. But we had not done the same with the libswoc unit tests. This ports libswoc unit_tests into ATS and ties it into our cmake system so that they are built and run as a part of ATS unit tests. (cherry picked from commit 20bae7f)
Contributor
|
Cherry-picked to v10.0.x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this PR, we had pulled in libswoc's production source code into ATS. But we had not done the same with the libswoc unit tests. This ports libswoc unit_tests into ATS and ties it into our cmake system so that they are built and run as a part of ATS unit tests.