mirror of
https://github.com/kopia/kopia.git
synced 2026-03-25 09:31:12 -04:00
refactor(general): minor cleanups (#4621)
- add assertion messages to help troubleshooting upload tests. - fix typo - fix debug log message
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
|
||||
const (
|
||||
parallelFetches = 5 // number of parallel reads goroutines
|
||||
flushPackIndexTimeout = 10 * time.Minute // time after which all pending indexes are flushes
|
||||
flushPackIndexTimeout = 10 * time.Minute // time after which all pending indexes are flushed
|
||||
defaultMinPreambleLength = 32
|
||||
defaultMaxPreambleLength = 32
|
||||
defaultPaddingUnit = 4096
|
||||
@@ -858,7 +858,7 @@ func (bm *WriteManager) GetContent(ctx context.Context, contentID ID) (v []byte,
|
||||
|
||||
_, err = bm.getContentDataAndInfo(ctx, contentID, &tmp)
|
||||
if err != nil {
|
||||
bm.log.Debugf("getContentInfoReadLocked(%v) error %v", contentID, err)
|
||||
bm.log.Debugf("getContentDataAndInfo(%v) error %v", contentID, err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
@@ -1259,11 +1259,16 @@ func TestParallelUploadOfLargeFiles(t *testing.T) {
|
||||
|
||||
fs.IterateEntries(ctx, dir, func(ctx context.Context, e fs.Entry) error {
|
||||
if f, ok := e.(fs.File); ok {
|
||||
oid, err := object.ParseID(strings.TrimPrefix(f.(object.HasObjectID).ObjectID().String(), "I"))
|
||||
require.NoError(t, err)
|
||||
hoid, hasObjectId := f.(object.HasObjectID)
|
||||
require.True(t, hasObjectId)
|
||||
|
||||
oids := hoid.ObjectID().String()
|
||||
|
||||
oid, err := object.ParseID(strings.TrimPrefix(oids, "I"))
|
||||
require.NoError(t, err, "failed to parse object id", oids)
|
||||
|
||||
entries, err := object.LoadIndexObject(ctx, th.repo.(repo.DirectRepositoryWriter).ContentManager(), oid)
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, err, "failed to parse indirect object id", oid)
|
||||
|
||||
// ensure that index object contains breakpoints at all multiples of 'chunkSize'.
|
||||
// Because we picked unusual chunkSize, this proves that uploads happened individually
|
||||
|
||||
Reference in New Issue
Block a user