-
Notifications
You must be signed in to change notification settings - Fork 18
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
gracefully shutdown reporter & add agent-test-tool based e2e case #9
Conversation
Signed-off-by: tison <wander4096@gmail.com>
e8dd804
to
ee8b736
Compare
Signed-off-by: tison <wander4096@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #9 +/- ##
==========================================
- Coverage 88.60% 85.15% -3.45%
==========================================
Files 9 9
Lines 272 283 +11
==========================================
Hits 241 241
- Misses 31 42 +11
Continue to review full report at Codecov.
|
I noticed that we may not use mpsc::channel at all. Currently, the reporter flushes per context on the streaming rpc. May you provide other languages' reporter implementation as references and I can work for a proper API. |
Hi, if you want self-contained, this is another example. As a client, the official way to test is set up e2e, which this lib is only working as a client. |
This is how the test thing works, https://github.com/SkyAPM/cpp2sky/blob/main/.github/workflows/main.yml |
I would like to recommend you to add an e2e test case for this repo, which has more value from our experiences. |
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.
Sorry, I'm not sure how situation we should use self-contained reporters. Could you show me the usecase for it?
} | ||
} | ||
} | ||
rx.close(); | ||
while let Some(message) = rx.recv().await { |
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.
It may not be required anymore.
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.
No. If a select chooses shutdown first, there can be outstanding messages to be processed. We close the rx
so that there is no more inflight message, but the outstanding ones should be processed.
See also https://docs.rs/tokio/1.15.0/tokio/sync/mpsc/struct.Receiver.html#method.close for example.
That makes sense. I'm confused about how to run the example properly and failed to find a resource to set up the environment. Thanks for your information. Let me dig it out. |
Because you need a backend and UI, https://skywalking.apache.org/docs/main/v8.9.1/readme/. |
We preapred simple docker-compose envs here. |
All checks have passed in CI. How do I verify this sentence? |
@wu-sheng It seems the example can leave as is (without starting a server) and I can verify the graceful shutdown logic by fixing current e2e test. |
@tisonkun E2E has a very specific meaning in the SkyWalking context. There are 2 kinds of E2E tests.
You should follow (2) more for the rust plugin. This test is working as |
@wu-sheng @Shikugawa I can try to fix and verify e2e failure locally, but it seems our CI doesn't check the e2e test. Shall we add it also? |
Yes, e2e is a new case. |
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
bc855b3
to
b8fc551
Compare
11bc092
to
7f46110
Compare
515a14a
to
716bdb4
Compare
1240d59
to
54cfc17
Compare
Signed-off-by: tison <wander4096@gmail.com>
54cfc17
to
9b20bb7
Compare
It seems that |
depends_on should take effects, what is out of expectation is that consumer/provider tries to do something before OAP is ready. Please use depends_on:
oap:
condition: service_healthy And add a health check for OAP. NOTE: version 3.7 of docker compose file might not accept this syntax but I know 3.8 and 2.1 can. |
I have seen you added a health check. This is important. |
Signed-off-by: tison <wander4096@gmail.com>
d32013f
to
86241d4
Compare
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Adding healthCheck causes hang without explicit reason. Given that the consumer started quickly, I tend to revert the healthCheck for now. Signed-off-by: tison <wander4096@gmail.com>
Finally I hack through it. I think this is ready for review, |
Signed-off-by: tison <wander4096@gmail.com>
pip3 install --upgrade pip | ||
pip3 install setuptools | ||
pip3 install -r requirements.txt | ||
python3 tests/e2e/run_e2e.py --expected_file=tests/e2e/data/expected_context.yaml --max_retry_times=3 --target_path=/ping |
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 can't find the tests/e2e/data/expected_context.yaml
. How does this test pass? Could you check the logs?
Is this a run_e2e.py
bug or something?
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.
It's already in the codebase here: https://github.com/apache/skywalking-rust/blob/1465d9fc6811dcb009e75f5c1dd2d5b1ef7a52a9/tests/e2e/data/expected_context.yaml
I don't add a new test case but according to your suggestion #9 (comment), enable the existing but not in regression e2e test - it's a plugin test based on agent-test-tool.
@Shikugawa Please check the codes. |
@tisonkun Please rename the title to make the changes clear. |
@wu-sheng updated. Notify me if it's better to split into two PRs. |
I am fine that these two are in one PR, as this repo is a very early stage. But I hope you could recheck the test coverage
I am not sure whether e2e testing could be counted in Rust, but it can be in the Java. |
@wu-sheng I checked the report and don't think it's a real regression:
|
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.
Great. Thank you for changing!
I got a notification that e2e of merged commit has failed in 9s after e2e began. |
@wu-sheng @Shikugawa according to the failure report, it seems the received data is unstable (not stably matches the expected data). https://github.com/apache/skywalking-rust/runs/4818192129?check_suite_focus=true
|
I think the key point is |
Signed-off-by: tison wander4096@gmail.com
cc @wu-sheng @Shikugawa