Sravya Tirukkovalur created SENTRY-1490:
-------------------------------------------

             Summary: 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 setups 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)

Reply via email to