-
Notifications
You must be signed in to change notification settings - Fork 849
Add ssn and txn tests for HTTP2. Depends on Issue #3143. Depends on PR #3301 #3047
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
Conversation
b78ed01 to
e5df75b
Compare
|
Please check the return code error
|
e5df75b to
bf7da85
Compare
|
[approve ci] |
|
Test errors cannot be reproduced locally. What should I do in this situation? https://ci.trafficserver.apache.org/job/autest-github/3608/console |
|
[approve ci] |
|
[approve ci autest] |
46c4819 to
adc02f2
Compare
b4e00ec to
66cfebc
Compare
| from random import randint | ||
| Test.Summary = ''' | ||
| Test transactions and sessions, making sure they open and close in the proper order. | ||
| Test transactions and sessions, making sure they two continuations catch the same number of hooks. |
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 they?
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.
done
| Test transactions and sessions, making sure they two continuations catch the same number of hooks. | ||
| ''' | ||
| # need Apache Benchmark. For RHEL7, this is httpd-tools | ||
| # needs curl |
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.
We can remove this comment.
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.
done
| ) | ||
|
|
||
| numberOfRequests = randint(1000, 1500) | ||
| numberOfRequests = 10 |
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.
Do we need this variable?
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 think it makes the intention of the loop more clear. or for ((i=0; i<10; i++)) might be missed that 10 is the number of requests
| # Make calls to the proxy! | ||
| tr = Test.AddTestRun() | ||
| tr.Processes.Default.Command = 'ab -n {0} -c 10 http://127.0.0.1:{1}/;sleep 5'.format(numberOfRequests, ts.Variables.port) | ||
| tr.Processes.Default.Command = 'for ((i=0; i<{0}; i++)); do curl -k https://127.0.0.1:{1}; done; sleep 5'.format(numberOfRequests, ts.Variables.port) |
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.
- Do we still need the sleep here?
- Does it matter that the client requests will be made serially instead of in parallel?
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.
The sleep is necessary because traffic_ctl needs to process and output the metrics. Without it, TSStatIntIncrement may not register.
Requests should be made in parallel. Good point. Changed
| # curl with http2 | ||
| tr.Processes.Default.Command = 'for ((i=0; i<{0}; i++)); do curl --http2 -k https://127.0.0.1:{1}; done; sleep 5'.format(numberOfRequests, ts.Variables.ssl_port) | ||
| tr.Processes.Default.ReturnCode = 0 | ||
| # time delay as proxy.config.http.wait_for_cache could be broken |
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.
Does this mean this config's functionality is, in fact, broken? We should open an issue and fix it rather than working around it in multiple tests.
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 think the delay is to prevent it from breaking in autest. This appears across multiple tests.
| Test transactions and sessions for http2, making sure the two continuations catch the same number of hooks. | ||
| ''' | ||
| Test.SkipUnless( | ||
| Condition.HasProgram("curl", "Curl need to be installed on system for this test to work"), |
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.
needs
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.
done.
| Test.SkipUnless( | ||
| Condition.HasProgram( | ||
| "ab", "apache benchmark (httpd-tools) needs to be installed on system for this test to work") | ||
| Condition.HasProgram("curl", "Curl need to be installed on system for this test to work") |
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.
needs
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.
done.
| Test transactions and sessions for http2, making sure they open and close in the proper order. | ||
| ''' | ||
| Test.SkipUnless( | ||
| Condition.HasProgram("curl", "Curl need to be installed on system for this test to work"), |
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.
needs
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.
done.
| tr.Processes.Default.ReturnCode = 0 | ||
| tr.Processes.Default.Env = ts.Env | ||
| tr.Processes.Default.Streams.stdout = Testers.ExcludesExpression( | ||
| " 0", 'should be nonzero') |
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 testing that the output is 0, but if it is not then we fail the test saying it should be nonzero?
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 to see how many sessions have been closed. It should be non zero. If it is 0 this is an error. Note, it's ExcludesExpression.
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.
Ah, you're right. I misread it as another ContainsExpression.
| yS7FDj5JgCU15hZgFk1iPx3HCt44jZM2HaL+UUHAzRQjKxTLAl3G1rWVAWLMyQML | ||
| lORoveLvotl4HOruSsMCQQCAx9dV9JUSFoyc1CWILp/FgUH/se4cjQCThGO0DoQQ | ||
| vGTYmntY7j9WRJ9esQrjdD6Clw8zM/45GIBNwnXzqo7Z | ||
| -----END RSA PRIVATE KEY----- |
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.
We are duplicating the private key here. Do we need two copies?
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.
ya multiple test folders have copies of this key. if we want to move to all of the keys to a single folder that might be a seperate pr.
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.
Let's leave it.
66cfebc to
7f4bcec
Compare
|
[approve ci autest] |
|
TS is seg faulting on these tests. Investigating. |
7f4bcec to
7d06e6e
Compare
Yeah it is good that you found the problem with this test. Probably we need to track a solution to that problem in a new GitHub issue and block this PR on the new issue. And this test should have a good number of requests, not a lower number of requests so as to avoid the segfault. |
|
[approve ci debian] |
|
|
||
| tr = Test.AddTestRun() | ||
| # curl with http2 | ||
| tr.Processes.Default.Command = 'for ((i=0; i<{0}; i++)); do curl -vs -k --http2 https://127.0.0.1:{1} & done; wait; sleep 10'.format(numberOfRequests, ts.Variables.ssl_port) |
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 can be done without the shell.
Example:
def make_curl_chain(tr,num):
ret=[]
for cnt in range(0,num):
ret.append(
tr.Processes.Process(
name="curl-{num}".format(num=cnt),
cmdstr="curl -vs -k --http2 http://127.0.0.1:{port}".format(port = ts.Variables.port),
returncode = 0
)
)
return ret
tr = Test.AddTestRun()
tr.Processes.Default.Command = 'curl -vs -k --http2 http://127.0.0.1:{1}'.format(numberOfRequests, ts.Variables.port)
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.StartAfter(
*make_curl_chain(tr,numberOfRequests)
)
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 think the idea is to have all the curl commands run in parallel. From my understanding, if you chain test runs like this, even if you use & in the cmdstr the test runs are sequential rather than in parallel because you have finish each test run and get a return code before moving on to the next.
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.
That is what this does
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.
updated.
65d4ec2 to
dae951d
Compare
|
[approve ci autest] |
|
@xf6wang in addition to the test failures for double and http2, there are a lot of the following: This doesn't look intentional, and we should try to silence these warnings if possible. Not sure about the |
|
@d2r I think those messages are related to a bug in autest. If you look at the This test needs a new drop of autest from @dragon512. |
OK is there a related pull request to upgrade our version of autest? It might be simpler to use the shell: bash -c 'for i in {0..$N}; do (curl $args || kill 0) & done; wait' |
|
I'm not sure about the PR for autest. I don't think that would be part of this repo. I had a loop for the |
I mean, if trafficserver is going to upgrade the version of autest it uses, is there a pull request for that change that we should point to as a dependency? How do we upgrade the autest version? |
|
Oh, I misunderstood. I don't think there has been a PR made on autest yet. But, when that happens, I think: https://github.com/apache/trafficserver/blob/master/tests/gold_tests/autest-site/init.cli.ext#L26 needs to be updated. |
28bec5b to
0995dff
Compare
0995dff to
94de5ea
Compare
94de5ea to
8431783
Compare
|
[approve ci clang-format] |
Existing tests ensure that the open and close hooks for transactions and sessions match up. Modified existing tests to use curl instead of ab to remove dependancy. New tests use "curl --http2" to verify functionality with HTTP/2 requests.
openclose.test.py & openclose_h2.test.py use ssntxnorder_verify.cc plugin
double.test.py & double_h2.test.py use continuation_verify.cc plugin