@@ -58,7 +58,7 @@ var expiredKeyForTesting = KeyConfig{
5858}
5959
6060func TestWriteWithPredefinedIntegrity (t * testing.T ) {
61- ds , err := dsfortesting .NewMemDBDatastoreForTesting (0 , 5 * time .Second , 1 * time .Hour )
61+ ds , err := dsfortesting .NewMemDBDatastoreForTesting (t , 0 , 5 * time .Second , 1 * time .Hour )
6262 require .NoError (t , err )
6363
6464 pds , err := NewRelationshipIntegrityProxy (ds , DefaultKeyForTesting , nil )
@@ -76,7 +76,7 @@ func TestWriteWithPredefinedIntegrity(t *testing.T) {
7676}
7777
7878func TestReadWithMissingIntegrity (t * testing.T ) {
79- ds , err := dsfortesting .NewMemDBDatastoreForTesting (0 , 5 * time .Second , 1 * time .Hour )
79+ ds , err := dsfortesting .NewMemDBDatastoreForTesting (t , 0 , 5 * time .Second , 1 * time .Hour )
8080 require .NoError (t , err )
8181
8282 // Write a relationship to the underlying datastore without integrity information.
@@ -108,7 +108,7 @@ func TestReadWithMissingIntegrity(t *testing.T) {
108108}
109109
110110func TestBasicIntegrityFailureDueToInvalidHashVersion (t * testing.T ) {
111- ds , err := dsfortesting .NewMemDBDatastoreForTesting (0 , 5 * time .Second , 1 * time .Hour )
111+ ds , err := dsfortesting .NewMemDBDatastoreForTesting (t , 0 , 5 * time .Second , 1 * time .Hour )
112112 require .NoError (t , err )
113113
114114 pds , err := NewRelationshipIntegrityProxy (ds , DefaultKeyForTesting , nil )
@@ -157,7 +157,7 @@ func TestBasicIntegrityFailureDueToInvalidHashVersion(t *testing.T) {
157157}
158158
159159func TestBasicIntegrityFailureDueToInvalidHashSignature (t * testing.T ) {
160- ds , err := dsfortesting .NewMemDBDatastoreForTesting (0 , 5 * time .Second , 1 * time .Hour )
160+ ds , err := dsfortesting .NewMemDBDatastoreForTesting (t , 0 , 5 * time .Second , 1 * time .Hour )
161161 require .NoError (t , err )
162162
163163 pds , err := NewRelationshipIntegrityProxy (ds , DefaultKeyForTesting , nil )
@@ -206,7 +206,7 @@ func TestBasicIntegrityFailureDueToInvalidHashSignature(t *testing.T) {
206206}
207207
208208func TestBasicIntegrityFailureDueToWriteWithExpiredKey (t * testing.T ) {
209- ds , err := dsfortesting .NewMemDBDatastoreForTesting (0 , 5 * time .Second , 1 * time .Hour )
209+ ds , err := dsfortesting .NewMemDBDatastoreForTesting (t , 0 , 5 * time .Second , 1 * time .Hour )
210210 require .NoError (t , err )
211211
212212 // Create a proxy with the to-be-expired key and write some relationships.
@@ -247,11 +247,8 @@ func TestBasicIntegrityFailureDueToWriteWithExpiredKey(t *testing.T) {
247247func TestWatchIntegrityFailureDueToInvalidHashSignature (t * testing.T ) {
248248 t .Parallel ()
249249
250- ds , err := dsfortesting .NewMemDBDatastoreForTesting (0 , 5 * time .Second , 1 * time .Hour )
250+ ds , err := dsfortesting .NewMemDBDatastoreForTesting (t , 0 , 5 * time .Second , 1 * time .Hour )
251251 require .NoError (t , err )
252- t .Cleanup (func () {
253- _ = ds .Close ()
254- })
255252
256253 headRev , err := ds .HeadRevision (t .Context ())
257254 require .NoError (t , err )
@@ -293,7 +290,7 @@ func TestWatchIntegrityFailureDueToInvalidHashSignature(t *testing.T) {
293290func BenchmarkQueryRelsWithIntegrity (b * testing.B ) {
294291 for _ , withIntegrity := range []bool {true , false } {
295292 b .Run (fmt .Sprintf ("withIntegrity=%t" , withIntegrity ), func (b * testing.B ) {
296- ds , err := dsfortesting .NewMemDBDatastoreForTesting (0 , 5 * time .Second , 1 * time .Hour )
293+ ds , err := dsfortesting .NewMemDBDatastoreForTesting (b , 0 , 5 * time .Second , 1 * time .Hour )
297294 require .NoError (b , err )
298295
299296 pds , err := NewRelationshipIntegrityProxy (ds , DefaultKeyForTesting , nil )
0 commit comments