engine: Add a ctx to the CheckApply API

This is just a rough port, there are lots of optimizations to be done
and lots of timeout values that should be replaced by a new timeout meta
param!
This commit is contained in:
James Shubin
2023-09-01 22:56:32 -04:00
parent 567de2e115
commit 7ccda7e99b
37 changed files with 175 additions and 120 deletions

View File

@@ -644,7 +644,7 @@ func TestResources1(t *testing.T) {
}
t.Logf("test #%d: running CheckApply", index)
checkOK, err := res.CheckApply(true) // no noop!
checkOK, err := res.CheckApply(doneCtx, true) // no noop!
if err != nil {
t.Errorf("test #%d: FAIL", index)
t.Errorf("test #%d: CheckApply failed: %s", index, err.Error())
@@ -771,7 +771,7 @@ func TestResources2(t *testing.T) {
// the returned error.
resCheckApplyError := func(res engine.Res, expCheckOK bool, errOK func(e error) error) func() error {
return func() error {
checkOK, err := res.CheckApply(true) // no noop!
checkOK, err := res.CheckApply(context.TODO(), true) // no noop!
if e := errOK(err); e != nil {
return errwrap.Wrapf(e, "error from CheckApply did not match expected")
}