From: Tom Clegg Date: Tue, 26 Jul 2016 16:25:35 +0000 (-0400) Subject: 8555: Test Get() after successful Untrash. Test Put+Mtime in all scenarios. X-Git-Tag: 1.1.0~815^2~4 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/482afcd3cda97329e68b2b77f7f4a32da6ea08ef 8555: Test Get() after successful Untrash. Test Put+Mtime in all scenarios. --- diff --git a/services/keepstore/s3_volume_test.go b/services/keepstore/s3_volume_test.go index e41e04b363..65ce2beb20 100644 --- a/services/keepstore/s3_volume_test.go +++ b/services/keepstore/s3_volume_test.go @@ -270,6 +270,14 @@ func (s *StubbedS3Suite) TestBackendStates(c *check.C) { loc, blk = setupScenario() err = v.Untrash(loc) c.Check(err == nil, check.Equals, scenario.canUntrash) + if scenario.dataT != none || scenario.trashT != none { + // In all scenarios where the data exists, we + // should be able to Get after Untrash -- + // regardless of timestamps, errors, race + // conditions, etc. + _, err = v.Get(loc, buf) + c.Check(err, check.IsNil) + } loc, blk = setupScenario() v.EmptyTrash() @@ -282,6 +290,13 @@ func (s *StubbedS3Suite) TestBackendStates(c *check.C) { // allowance for 1s timestamp precision) c.Check(t.After(t0.Add(-time.Second)), check.Equals, true) } + + loc, blk = setupScenario() + err = v.Put(loc, blk) + c.Check(err, check.IsNil) + t, err := v.Mtime(loc) + c.Check(err, check.IsNil) + c.Check(t.After(t0.Add(-time.Second)), check.Equals, true) } }