StorageDriver: Test suite: improve cleanup
Verify that the file(s) have been deleted after calling Delete, and retry if this is not the case. Furthermore, report the error if a Delete operation fails. Signed-off-by: Arthur Baars <arthur@semmle.com>
This commit is contained in:
parent
e4b654f2ce
commit
ffc9527782
3 changed files with 57 additions and 26 deletions
|
@ -155,8 +155,12 @@ func TestEmptyRootList(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatalf("unexpected error creating content: %v", err)
|
||||
}
|
||||
defer rootedDriver.Delete(ctx, filename)
|
||||
|
||||
defer func() {
|
||||
err := rootedDriver.Delete(ctx, filename)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to remove %v due to %v\n", filename, err)
|
||||
}
|
||||
}()
|
||||
keys, err := emptyRootDriver.List(ctx, "/")
|
||||
for _, path := range keys {
|
||||
if !storagedriver.PathRegexp.MatchString(path) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue