-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xcodebuild command can not launch test on device/simulator #234
Comments
Hi @lucasromanomr! Hard to tell without some more context. Mind sharing a small project or repo that reproduces the issue? |
I cannot share the project because it is a private project of the company. I am running the module and application tests. All at once. Example:
Some tests are for everyone on top of the host, or better saying, run on top of the simulator: apple_framework(
name = "Core",
module_name = "Core",
platforms = {"ios": "10.3"},
srcs = glob([
"Core/**/*.h",
"Core/**/*.m",
"Core/**/*.swift",
]),
resource_bundles = {
"CoreResources": glob([
"Core/**/*.xcassets/**",
"Core/**/*.strings",
"Core/**/*.cer",
"Core/**/*.png",
]),
},
deps = ["@//Pods/KeychainAccess"],
visibility = ["//visibility:public"],
)
apple_framework(
name = "CoreTestsLib",
deps = [
":Core",
],
srcs = glob(["CoreTests/**/*.swift"]),
data = glob([
"CoreTests/**/*.json",
"CoreTests/**/*.xcassets/**",
"CoreTests/**/*.cer"
]),
)
ios_unit_test(
name = "CoreTests",
minimum_os_version = "12.0",
deps = [":CoreTestsLib"],
test_host = True
) As well as applications. Apparently it happens that when it is time to run or call the simulator, it is waiting for the simulator to finish initializing so that afterwards the tests can start, but after the timeout on top of the simulator, interrupting the tests. As it says in the log line that I sent earlier:
|
@lucasromanomr We've had (and still are having) this problem. To get around it we've done a few things. First we have upped the amount of time to run to 300s, you can do this by passing in Second we have a wrapper script that is caled from CI that callls the The last thing we do is we do when we detect that it was a simulator launch failure we do some of the suggestions here: bazelbuild/rules_apple#185 (comment) which often will fix the problem. We've thought about even calling it before calling There are a few things we also have in mind to do that we haven't gotten to yet, one being start using a cloning mechanism rather than a creating mechanism from within the xctestrunner. This would require us to update it however, according to apple cloning is a much faster and less resource intensive action than creating. The other thing we've thought about doing it using bluepill which seems to do a good job of managing simulators. I hope this helps! |
@dostrander Thank you very much for the return, I had seen this issue there, I will return with the exclusive and kill the simulators as it was before (as I was still having a problem I ended up removing it). About setting the timeout ( |
@lucasromanomr that would go in the |
@thiagohmcruz, @dostrander Hello, sorry, i'm starting in bazel in some parts. How would I go about passing those arguments on? it would go through Would you like to put an example of how to pass these arguments on to bazel? |
Allow simulator more time to start running a test bundle. Aims to fix: ``` 2022-12-01 20:12:58,627 The xcodebuild command got stuck and has not started test in 150. Will kill the command directly. ``` Related to bazel-ios/rules_ios#234.
I was having this problem many times in the CI, but now I started running the bazel locally too, it only happens when I run the tests, and these certain tests need the simulator to run
I was thinking that it could be something about the processing on top of the machine, I did some tests limiting the number of jobs I had on the tests, but still giving the same thing.
Note: I am running several tests at the same time, and a command that runs the tests of all modules in the project. Does anyone have any idea what they can help solve?
Xcode: 12.4
OS: Bir Sur 11.2.3
The text was updated successfully, but these errors were encountered: