-
Notifications
You must be signed in to change notification settings - Fork 21
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
chore: make sure storage tests use unique stores #1433
Conversation
beforeAll(async () => { | ||
await createStoreIfNotExists(storageClient, integrationTestStoreName); | ||
}); | ||
|
||
afterAll(async () => { | ||
await deleteStoreIfExists(storageClient, integrationTestStoreName); | ||
}); |
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.
added a beforeAll
and afterAll
to create a shared store that can be used by storage data plane tests. this will prevent leaked stores and ensure minimal creation of stores where possible.
switch (putBytesResponse.type) { | ||
case StoragePutResponse.Success: { | ||
// WithStore creates a store then deletes it | ||
await WithStore(storageClient, storeName, async () => { |
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.
used WithStore in this test to make it more concise, but it does the same thing as before (calls create, create, delete)
}, `expected NotFound, received ${getResponse.toString()}`); | ||
expect(getResponse.value()).toBeUndefined(); | ||
}); | ||
}); | ||
it('should return store not found error for deleting a store that doesnt exist', async () => { |
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.
moved 'should return store not found error for deleting a store that doesnt exist' to the storage control plane block of tests
await sleep(5000); | ||
// Data plane tests should use the shared integration test store | ||
// with the BeforeAll setup and AfterAll teardown | ||
describe('#store get put and delete', () => { |
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.
all the storage data plane tests should be in this describe block and should use the shared store with unique keys
Should use the
WithStore
helper function to create a unique store for each storage control plane test.Creates single shared store for storage data plane tests using a
beforeAll
and is cleaned up using anafterAll
.Remove the "should successfully make two of the same requests after 5s retry timeout" test, which I added to test an edge case while developing the storage retry strategy, but it is no longer relevant after collapsing the fixed timeout interceptor into the retry interceptor.