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

Improving the use of identifiers for integration tests #479

Closed
wants to merge 3 commits into from

Conversation

ajs6f
Copy link
Contributor

@ajs6f ajs6f commented Sep 17, 2014

@@ -39,7 +39,7 @@ public void setLogger() {
}

public String getRandomPid() {
return UUID.randomUUID().toString();
return currentThread().getStackTrace()[2].getMethodName() + "-" + randomUUID();
Copy link

Choose a reason for hiding this comment

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

I am fine with this approach, but are you suggesting that we are actually getting conflicts with UUID.ranomUUID()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

L-rd no. I did that so that the identifiers are useful when we're paging through screens and screens of test logs. That's going to become more important if we go to a multithreaded world where tests are being interleaved. I wanted that, but I didn't want everyone to have to start every test with the following lines:

public void myTest() { final String myTestPid = "myTest-" + randomUUID()

Admittedly, now they'll do:

public void myTest() { final String myTestPid = getRandomPid()

but at least there's no hard-coded test name in the code of the test itself.

@awoods
Copy link

awoods commented Sep 17, 2014

Looks like a solid way forward.

@ajs6f
Copy link
Contributor Author

ajs6f commented Sep 17, 2014

Okay, should we leave this PR hanging and I'll just add to it?

@awoods
Copy link

awoods commented Sep 18, 2014

Adding to the PR is fine, unless you want to minimize the overhead of rebases.

@ajs6f
Copy link
Contributor Author

ajs6f commented Sep 19, 2014

I'm about to go on vacation for the weekend, so if you want to merge this as an intermediate step and keep the ticket open, that's probably a good thing, or you can leave it be until Monday. I don't know where @cbeer 's kernel stuff is, and obviously I'd rather not run into merge hell.

@awoods
Copy link

awoods commented Sep 19, 2014

Thanks. I will see how clean/messy the merge of this is after @cbeer's PR goes in. Enjoy the weekend.

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

Successfully merging this pull request may close these issues.

None yet

2 participants