Integrating batch calculations into an AutoPause monitor which provides some guarantees to the user.

This commit is contained in:
Renan DelValle 2019-09-18 15:38:58 -07:00
parent b73954cd7c
commit a0fa99df8a
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9
3 changed files with 60 additions and 64 deletions

View file

@ -1013,19 +1013,16 @@ func TestRealisClient_BatchAwareAutoPause(t *testing.T) {
require.NotNil(t, resp.GetResult_().GetStartJobUpdateResult_())
require.NotNil(t, resp.GetResult_().GetStartJobUpdateResult_().GetKey())
var ok bool
var mErr error
key := *resp.GetResult_().GetStartJobUpdateResult_().GetKey()
for i := range updateGroups {
if ok, mErr = monitor.PausedUpdateMonitor(key, time.Second*5, time.Second*240); !ok || mErr != nil {
curStep, mErr := monitor.AutoPausedUpdateMonitor(key, time.Second*5, time.Second*240)
if mErr != nil {
// Update may already be in a terminal state so don't check for error
_, err := r.AbortJobUpdate(key, "Monitor timed out.")
assert.NoError(t, err)
}
curStep, err := r.VariableBatchStep(key)
assert.NoError(t, err)
assert.Equal(t, i, curStep)
_, err = r.ResumeJobUpdate(&key, "auto resuming test")