dubbo-go-bot opened a new pull request, #819: URL: https://github.com/apache/dubbo-go-pixiu/pull/819
## 🔄 Upstream Sync from Community Fork This PR automatically syncs changes from the community fork to the upstream repository. ### Original Contribution - **Author**: @Similarityoung - **Original PR**: https://github.com/dubbo-go-pixiu/dubbo-go-pixiu/pull/40 - **Merged at**: 2025-11-28 02:24:00 UTC ### Original PR Description --- ### **User description** <!-- Thanks for sending a pull request! --> **What this PR does**: fix benchmark **Which issue(s) this PR fixes**: <!-- *Automatically closes linked issue when PR is merged. Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. _If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_* --> Fixes https://github.com/apache/dubbo-go-pixiu/issues/805 **Special notes for your reviewer**: There are two remaining TODOs: Currently, I have only configured the test Dubbo server to support both application and interface modes. Theoretically, Pixiu currently supports generic invocation only in interface mode and is not yet compatible with application-level generic invocation. This support is pending future upgrades. Regarding the test sequence: it is mandatory to test the gateway capabilities first, followed by the direct Dubbo client-to-server capabilities. If this order is reversed, the initial test passes, but subsequent tests fail until Pixiu is rebuilt. I have not yet identified the root cause of this issue. ___ ### **PR Type** Bug fix, Tests, Enhancement ___ ### **Description** - Reorganized benchmark tests to run gateway tests before direct client tests - Added port availability checks and improved server startup synchronization - Enhanced process cleanup with Kill instead of Terminate for reliable shutdown - Fixed test execution order dependency and added working directory configuration - Removed unused config.Version import and added TODO comment for future cleanup ___ ### Diagram Walkthrough ```mermaid flowchart LR A["Test Initialization"] --> B["Port Availability Check"] B --> C["Start Dubbo/Triple Server"] C --> D["Wait for Service Registration"] D --> E["Start Pixiu Gateway"] E --> F["Wait for Service Discovery"] F --> G["Run Gateway Tests First"] G --> H["Run Direct Client Tests"] H --> I["Cleanup with Kill"] I --> J["Release Ports"] ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Cleanup</strong></td><td><table> <tr> <td> <details> <summary><strong>dubbo.go</strong><dd><code>Remove unused config import and version reference</code> </dd></summary> <hr> pkg/client/dubbo/dubbo.go <ul><li>Removed unused <code>config</code> package import<br> <li> Removed <code>config.Version</code> reference from <code>defaultApplication</code> <br>initialization<br> <li> Added TODO comment indicating potential future cleanup of Version <br>constant</ul> </details> </td> <td><a href="https://github.com/dubbo-go-pixiu/dubbo-go-pixiu/pull/40/files#diff-1f73347753bf43f97bf0ecd965437bb343d893ca0884e7707ddbe40aaef841cb">+0/-2</a> </td> </tr> </table></td></tr><tr><td><strong>Documentation</strong></td><td><table> <tr> <td> <details> <summary><strong>version.go</strong><dd><code>Add TODO comment for Version constant</code> </dd></summary> <hr> pkg/config/version.go <ul><li>Added TODO comment indicating Version constant may be deleted in <br>future</ul> </details> </td> <td><a href="https://github.com/dubbo-go-pixiu/dubbo-go-pixiu/pull/40/files#diff-8936491993d96ee70d710740f2ae4eaa340400df6c3f88afb98c700aac838bb5">+1/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>dubbo_test.go</strong><dd><code>Reorganize tests and improve startup/cleanup reliability</code> </dd></summary> <hr> tools/benchmark/test/dubbo_suite/dubbo_test.go <ul><li>Added <code>net</code> package import for port availability checking<br> <li> Implemented <code>waitForPortAvailable()</code> function to check port availability <br>before server startup<br> <li> Reorganized test execution order: gateway tests now run before direct <br>client tests<br> <li> Moved <code>prepareDubboClient()</code> call into the direct client test instead of <br>BeforeAll<br> <li> Enhanced server startup with proper wait times for Zookeeper <br>registration and service discovery<br> <li> Changed process cleanup from Terminate to Kill for more reliable <br>shutdown<br> <li> Added <code>gexec.CleanupBuildArtifacts()</code> call and port release wait time<br> <li> Set working directory for server process to ensure relative paths work <br>correctly<br> <li> Changed server output from <code>io.Discard</code> to <code>GinkgoWriter</code> for better <br>debugging<br> <li> Fixed HTTP response body read order in test assertions</ul> </details> </td> <td><a href="https://github.com/dubbo-go-pixiu/dubbo-go-pixiu/pull/40/files#diff-2a1684bd664cf6aa1a66f33b85e20b3db92d85bf24f2f5010b01c964665f7f42">+95/-69</a> </td> </tr> <tr> <td> <details> <summary><strong>proto_test.go</strong><dd><code>Reorganize tests and improve startup/cleanup reliability</code> </dd></summary> <hr> tools/benchmark/test/triple_suite/proto_suite/proto_test.go <ul><li>Added <code>net</code> package import for port availability checking<br> <li> Reorganized imports to follow Go conventions<br> <li> Implemented <code>waitForPortAvailable()</code> function for port availability <br>checks<br> <li> Reorganized test execution order: gateway tests now run before direct <br>client tests<br> <li> Moved <code>prepareTripleClient()</code> call into the direct client test instead <br>of BeforeAll<br> <li> Enhanced server startup with proper wait times for Zookeeper <br>registration and service discovery<br> <li> Changed process cleanup from Terminate to Kill for more reliable <br>shutdown<br> <li> Added <code>gexec.CleanupBuildArtifacts()</code> call and port release wait time<br> <li> Set working directory for server process<br> <li> Fixed JSON formatting in test data</ul> </details> </td> <td><a href="https://github.com/dubbo-go-pixiu/dubbo-go-pixiu/pull/40/files#diff-db457bebd7126f547461d837cc3fac8b19824c6359b17153f4bcb06e925a66aa">+62/-31</a> </td> </tr> </table></td></tr><tr><td><strong>Configuration changes</strong></td><td><table> <tr> <td> <details> <summary><strong>dubbogo.yml</strong><dd><code>Configure registry type and provider registry IDs</code> </dd></summary> <hr> tools/benchmark/protocol/dubbo/go-server/conf/dubbogo.yml <ul><li>Added <code>registry-type: all</code> to Zookeeper registry configuration<br> <li> Added <code>registry-ids: demoZK</code> to provider configuration to explicitly <br>specify registry</ul> </details> </td> <td><a href="https://github.com/dubbo-go-pixiu/dubbo-go-pixiu/pull/40/files#diff-3f60fe320457ef6c8ae354147346081d17be8f4790496bb05ce9e154bcfa62f7">+2/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>dubbogo.yml</strong><dd><code>Configure registry type and provider registry IDs</code> </dd></summary> <hr> tools/benchmark/protocol/triple/pb/go-server/conf/dubbogo.yml <ul><li>Added <code>registry-type: all</code> to Zookeeper registry configuration<br> <li> Added <code>registry-ids: zk</code> to provider configuration to explicitly specify <br>registry</ul> </details> </td> <td><a href="https://github.com/dubbo-go-pixiu/dubbo-go-pixiu/pull/40/files#diff-ce8ffce6d0a198cbf5d7afcd999779f14626b727cce65c78fc13cc89c313374d">+2/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> </details> ___ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved test reliability with port-availability checks, ordered startup, and more robust process shutdown to prevent timing/race issues. * **Tests** * Added dedicated performance benchmarks for Dubbo and Triple protocols and a separate Dubbo performance test. * Improved test IO handling and startup sequencing (port waits, service-discovery waits, working-directory handling). * **Chores** * Updated benchmark registry configuration mappings. * **Documentation** * Expanded benchmark READMEs with Dubbo and Triple results and sections. * **Other** * Adjusted default application metadata to remove an implicit version assignment; added an inline config comment. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- All commits preserve original authorship. **Note**: Auto-created when PR #40 was merged into `dubbo-go-pixiu/dubbo-go-pixiu:develop`. cc @Similarityoung -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
