Skip to content
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

HIVE-28194: Regenerate HS2 thrift port in TestRetryingThriftCLIServiceClient #5205

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

armitage420
Copy link
Contributor

What changes were proposed in this pull request?

Hive thrift port was hardcoded to 15000, hence port regeneration code was added here

Why are the changes needed?

Testcase can fail if the port is occupied by another test in testsplit pipeline

Does this PR introduce any user-facing change?

No

Is the change a dependency upgrade?

No

How was this patch tested?

Local machine

server.start();
Thread.sleep(5000);
System.out.println("## HiveServer started");
private void startHiveServer() throws Exception {
Copy link
Member

@deniskuzZ deniskuzZ Apr 22, 2024

Choose a reason for hiding this comment

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

that looks similar to TestHS2HttpServer#beforeTests, would be nice to extract common code into a base class and return the port HS2 was started on

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deniskuzZ I have made a few changes please have a look!


@Before
public void init() {
hiveConf = new HiveConf();
hiveConf.setVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST, "localhost");
hiveConf.setIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_PORT, 15000);
hiveConf.setIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_PORT, port);
Copy link
Member

Choose a reason for hiding this comment

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

what's the use of it, since HS2 start is done later and free port could be different?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, reverted it back to 15000

Copy link

sonarcloud bot commented May 1, 2024

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants