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
Conversation
@@ -39,7 +39,7 @@ public void setLogger() { | |||
} | |||
|
|||
public String getRandomPid() { | |||
return UUID.randomUUID().toString(); | |||
return currentThread().getStackTrace()[2].getMethodName() + "-" + randomUUID(); |
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 am fine with this approach, but are you suggesting that we are actually getting conflicts with UUID.ranomUUID()?
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.
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.
Looks like a solid way forward. |
Okay, should we leave this PR hanging and I'll just add to it? |
Adding to the PR is fine, unless you want to minimize the overhead of rebases. |
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. |
Thanks. I will see how clean/messy the merge of this is after @cbeer's PR goes in. Enjoy the weekend. |
DO NOT MERGE
Example for:
https://www.pivotaltracker.com/story/show/79009208