From 6a9f1dce00ad4b277a1262c4238656d43be7bb13 Mon Sep 17 00:00:00 2001 From: Brian Krznarich Date: Wed, 10 Aug 2022 19:54:27 +0900 Subject: [PATCH] Fix shutdown error in TestXcuiTest() added in recent commit with new context support The new semantics of testmanagerd.RunXCUIWithBundleIdsCtx() are that if a context is passed, the context is supposed to have an associated cancel() method, which should be called to abort the method. The XCU Test method its> Passing a context does not interract well with testmanagerd.CloseXCUITestRunner(). It appears that you should use one (the context) or the other (testmanagerd.CloseXCUITestRunner), not both. It's arguable that this warrants a separate test, one for each invocation technique. As it stands, I haven't run the test since I don't have wda available to install, but I can confirm this is an issue in the invocation made from main.go "runwda". --- ios/testmanagerd/xcuitestrunner_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/testmanagerd/xcuitestrunner_test.go b/ios/testmanagerd/xcuitestrunner_test.go index 5148db58..4c26e1c0 100644 --- a/ios/testmanagerd/xcuitestrunner_test.go +++ b/ios/testmanagerd/xcuitestrunner_test.go @@ -53,7 +53,7 @@ func TestXcuiTest(t *testing.T) { var wdaargs []string var wdaenv []string go func() { - err := testmanagerd.RunXCUIWithBundleIdsCtx(context.Background(), bundleID, testbundleID, xctestconfig, device, wdaargs, wdaenv) + err := testmanagerd.RunXCUIWithBundleIdsCtx(nil, bundleID, testbundleID, xctestconfig, device, wdaargs, wdaenv) if err != nil { log.WithFields(log.Fields{"error": err}).Fatal("Failed running WDA")