remove stats.Errs
Now that fault errors is in place, we don't need the operation stats errs.
This commit is contained in:
parent
3de82f9a5b
commit
5cf020d5c8
@ -49,7 +49,6 @@ type BackupOperation struct {
|
|||||||
|
|
||||||
// BackupResults aggregate the details of the result of the operation.
|
// BackupResults aggregate the details of the result of the operation.
|
||||||
type BackupResults struct {
|
type BackupResults struct {
|
||||||
stats.Errs // deprecated in place of fault.Errors in the base operation.
|
|
||||||
stats.ReadWrites
|
stats.ReadWrites
|
||||||
stats.StartAndEndTime
|
stats.StartAndEndTime
|
||||||
BackupID model.StableID `json:"backupID"`
|
BackupID model.StableID `json:"backupID"`
|
||||||
|
|||||||
@ -155,8 +155,6 @@ func runAndCheckBackup(
|
|||||||
assert.Equal(t, 1, bo.Results.ResourceOwners, "count of resource owners")
|
assert.Equal(t, 1, bo.Results.ResourceOwners, "count of resource owners")
|
||||||
assert.NoError(t, bo.Errors.Failure(), "incremental non-recoverable error")
|
assert.NoError(t, bo.Errors.Failure(), "incremental non-recoverable error")
|
||||||
assert.Empty(t, bo.Errors.Recovered(), "incremental recoverable/iteration errors")
|
assert.Empty(t, bo.Errors.Recovered(), "incremental recoverable/iteration errors")
|
||||||
assert.NoError(t, bo.Results.ReadErrors, "errors reading data")
|
|
||||||
assert.NoError(t, bo.Results.WriteErrors, "errors writing data")
|
|
||||||
assert.Equal(t, 1, mb.TimesCalled[events.BackupStart], "backup-start events")
|
assert.Equal(t, 1, mb.TimesCalled[events.BackupStart], "backup-start events")
|
||||||
assert.Equal(t, 1, mb.TimesCalled[events.BackupEnd], "backup-end events")
|
assert.Equal(t, 1, mb.TimesCalled[events.BackupEnd], "backup-end events")
|
||||||
assert.Equal(t,
|
assert.Equal(t,
|
||||||
@ -628,8 +626,6 @@ func (suite *BackupOpIntegrationSuite) TestBackup_Run_exchange() {
|
|||||||
assert.Equal(t, bo.Results.ResourceOwners, incBO.Results.ResourceOwners, "incremental backup resource owner")
|
assert.Equal(t, bo.Results.ResourceOwners, incBO.Results.ResourceOwners, "incremental backup resource owner")
|
||||||
assert.NoError(t, incBO.Errors.Failure(), "incremental non-recoverable error")
|
assert.NoError(t, incBO.Errors.Failure(), "incremental non-recoverable error")
|
||||||
assert.Empty(t, incBO.Errors.Recovered(), "count incremental recoverable/iteration errors")
|
assert.Empty(t, incBO.Errors.Recovered(), "count incremental recoverable/iteration errors")
|
||||||
assert.NoError(t, incBO.Results.ReadErrors, "incremental read errors")
|
|
||||||
assert.NoError(t, incBO.Results.WriteErrors, "incremental write errors")
|
|
||||||
assert.Equal(t, 1, incMB.TimesCalled[events.BackupStart], "incremental backup-start events")
|
assert.Equal(t, 1, incMB.TimesCalled[events.BackupStart], "incremental backup-start events")
|
||||||
assert.Equal(t, 1, incMB.TimesCalled[events.BackupEnd], "incremental backup-end events")
|
assert.Equal(t, 1, incMB.TimesCalled[events.BackupEnd], "incremental backup-end events")
|
||||||
assert.Equal(t,
|
assert.Equal(t,
|
||||||
@ -1058,8 +1054,6 @@ func (suite *BackupOpIntegrationSuite) TestBackup_Run_exchangeIncrementals() {
|
|||||||
assert.Equal(t, test.itemsRead+4, incBO.Results.ItemsRead, "incremental items read")
|
assert.Equal(t, test.itemsRead+4, incBO.Results.ItemsRead, "incremental items read")
|
||||||
assert.NoError(t, incBO.Errors.Failure(), "incremental non-recoverable error")
|
assert.NoError(t, incBO.Errors.Failure(), "incremental non-recoverable error")
|
||||||
assert.Empty(t, incBO.Errors.Recovered(), "incremental recoverable/iteration errors")
|
assert.Empty(t, incBO.Errors.Recovered(), "incremental recoverable/iteration errors")
|
||||||
assert.NoError(t, incBO.Results.ReadErrors, "incremental read errors")
|
|
||||||
assert.NoError(t, incBO.Results.WriteErrors, "incremental write errors")
|
|
||||||
assert.Equal(t, 1, incMB.TimesCalled[events.BackupStart], "incremental backup-start events")
|
assert.Equal(t, 1, incMB.TimesCalled[events.BackupStart], "incremental backup-start events")
|
||||||
assert.Equal(t, 1, incMB.TimesCalled[events.BackupEnd], "incremental backup-end events")
|
assert.Equal(t, 1, incMB.TimesCalled[events.BackupEnd], "incremental backup-end events")
|
||||||
assert.Equal(t,
|
assert.Equal(t,
|
||||||
|
|||||||
@ -46,7 +46,6 @@ type RestoreOperation struct {
|
|||||||
|
|
||||||
// RestoreResults aggregate the details of the results of the operation.
|
// RestoreResults aggregate the details of the results of the operation.
|
||||||
type RestoreResults struct {
|
type RestoreResults struct {
|
||||||
stats.Errs // deprecated in place of fault.Errors in the base operation.
|
|
||||||
stats.ReadWrites
|
stats.ReadWrites
|
||||||
stats.StartAndEndTime
|
stats.StartAndEndTime
|
||||||
}
|
}
|
||||||
|
|||||||
@ -304,8 +304,6 @@ func (suite *RestoreOpIntegrationSuite) TestRestore_Run() {
|
|||||||
assert.Equal(t, 1, ro.Results.ResourceOwners, "resource Owners")
|
assert.Equal(t, 1, ro.Results.ResourceOwners, "resource Owners")
|
||||||
assert.NoError(t, ro.Errors.Failure(), "non-recoverable error")
|
assert.NoError(t, ro.Errors.Failure(), "non-recoverable error")
|
||||||
assert.Empty(t, ro.Errors.Recovered(), "recoverable errors")
|
assert.Empty(t, ro.Errors.Recovered(), "recoverable errors")
|
||||||
assert.NoError(t, ro.Results.ReadErrors, "errors while reading restore data")
|
|
||||||
assert.NoError(t, ro.Results.WriteErrors, "errors while writing restore data")
|
|
||||||
assert.Equal(t, suite.numItems, ro.Results.ItemsWritten, "backup and restore wrote the same num of items")
|
assert.Equal(t, suite.numItems, ro.Results.ItemsWritten, "backup and restore wrote the same num of items")
|
||||||
assert.Equal(t, 1, mb.TimesCalled[events.RestoreStart], "restore-start events")
|
assert.Equal(t, 1, mb.TimesCalled[events.RestoreStart], "restore-start events")
|
||||||
assert.Equal(t, 1, mb.TimesCalled[events.RestoreEnd], "restore-end events")
|
assert.Equal(t, 1, mb.TimesCalled[events.RestoreEnd], "restore-end events")
|
||||||
|
|||||||
@ -15,12 +15,6 @@ type ReadWrites struct {
|
|||||||
ResourceOwners int `json:"resourceOwners,omitempty"`
|
ResourceOwners int `json:"resourceOwners,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Errs tracks the aggregation of errors that occurred during a process.
|
|
||||||
type Errs struct {
|
|
||||||
ReadErrors error `json:"readErrors,omitempty"`
|
|
||||||
WriteErrors error `json:"writeErrors,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// StartAndEndTime tracks a paired starting time and ending time.
|
// StartAndEndTime tracks a paired starting time and ending time.
|
||||||
type StartAndEndTime struct {
|
type StartAndEndTime struct {
|
||||||
StartedAt time.Time `json:"startedAt"`
|
StartedAt time.Time `json:"startedAt"`
|
||||||
|
|||||||
@ -40,7 +40,6 @@ type Backup struct {
|
|||||||
Errors fault.Errors `json:"errors"`
|
Errors fault.Errors `json:"errors"`
|
||||||
|
|
||||||
// stats are embedded so that the values appear as top-level properties
|
// stats are embedded so that the values appear as top-level properties
|
||||||
stats.Errs // Deprecated, replaced with Errors.
|
|
||||||
stats.ReadWrites
|
stats.ReadWrites
|
||||||
stats.StartAndEndTime
|
stats.StartAndEndTime
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,10 +44,6 @@ func stubBackup(t time.Time) backup.Backup {
|
|||||||
Errors: fault.Errors{
|
Errors: fault.Errors{
|
||||||
Recovered: []error{errors.New("read"), errors.New("write")},
|
Recovered: []error{errors.New("read"), errors.New("write")},
|
||||||
},
|
},
|
||||||
Errs: stats.Errs{
|
|
||||||
ReadErrors: errors.New("1"),
|
|
||||||
WriteErrors: errors.New("1"),
|
|
||||||
},
|
|
||||||
ReadWrites: stats.ReadWrites{
|
ReadWrites: stats.ReadWrites{
|
||||||
BytesRead: 301,
|
BytesRead: 301,
|
||||||
BytesUploaded: 301,
|
BytesUploaded: 301,
|
||||||
|
|||||||
@ -187,8 +187,6 @@ func runBackupLoadTest(
|
|||||||
assert.Equal(t, len(users), b.Results.ResourceOwners, "resource owners")
|
assert.Equal(t, len(users), b.Results.ResourceOwners, "resource owners")
|
||||||
assert.NoError(t, b.Errors.Failure(), "non-recoverable error")
|
assert.NoError(t, b.Errors.Failure(), "non-recoverable error")
|
||||||
assert.Empty(t, b.Errors.Recovered(), "recoverable errors")
|
assert.Empty(t, b.Errors.Recovered(), "recoverable errors")
|
||||||
assert.NoError(t, b.Results.ReadErrors, "read errors")
|
|
||||||
assert.NoError(t, b.Results.WriteErrors, "write errors")
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,8 +294,6 @@ func doRestoreLoadTest(
|
|||||||
assert.Equal(t, len(users), r.Results.ResourceOwners, "resource owners")
|
assert.Equal(t, len(users), r.Results.ResourceOwners, "resource owners")
|
||||||
assert.NoError(t, r.Errors.Failure(), "non-recoverable error")
|
assert.NoError(t, r.Errors.Failure(), "non-recoverable error")
|
||||||
assert.Empty(t, r.Errors.Recovered(), "recoverable errors")
|
assert.Empty(t, r.Errors.Recovered(), "recoverable errors")
|
||||||
assert.NoError(t, r.Results.ReadErrors, "read errors")
|
|
||||||
assert.NoError(t, r.Results.WriteErrors, "write errors")
|
|
||||||
assert.Equal(t, expectItemCount, r.Results.ItemsWritten, "backup and restore wrote the same count of items")
|
assert.Equal(t, expectItemCount, r.Results.ItemsWritten, "backup and restore wrote the same count of items")
|
||||||
|
|
||||||
ensureAllUsersInDetails(t, users, ds, "restore", name)
|
ensureAllUsersInDetails(t, users, ds, "restore", name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user