[
https://issues.apache.org/jira/browse/SENTRY-1490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15552649#comment-15552649
]
Anne Yu commented on SENTRY-1490:
---------------------------------
[~sravya] I created a random string including all ascii characters plus numbers
as suffix. In that case if the length is n, theoretically we can have 1/256 ^ n
probability to get duplicates. Hope this can help.
> Make tests more robust with respect to isolation
> ------------------------------------------------
>
> Key: SENTRY-1490
> URL: https://issues.apache.org/jira/browse/SENTRY-1490
> Project: Sentry
> Issue Type: Test
> Reporter: Sravya Tirukkovalur
> Assignee: Sravya Tirukkovalur
> Priority: Minor
>
> Traditionally in our e2e tests, each test class sets up the backend database.
> And each test creates its own database and performs some operations and then
> we clean up the databases created as part of the test either within the test
> or in @After.
> There are some problems with this approach:
> - Not possible to run tests parallely, as more than one test can be using
> same environment(db).
> - If tests do not clean up well, it leads to cascading test failures due to
> incorrect assumptions.
> In the test TestDBNotificationListenerInBuiltDeserializer, I tried solving
> this problem by creating a random name for db in each test case where dbname=
> db+randomNumber. But the randomness does not seem to be sufficient as we are
> not making sure the random numbers are non repeating. I am thinking of either
> of the below solutions here:
> 1. Generate non repeating random names.
> 2. Use an atomic class integer rather than a random number.
> Can you think of any other simpler solutions?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)