Running examples in ‘spatialreg-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: set.mcOption
> ### Title: Options for parallel support
> ### Aliases: set.ClusterOption get.ClusterOption set.mcOption
> ###   get.coresOption set.coresOption get.mcOption
> ### Keywords: spatial
> 
> ### ** Examples
> 
> ls(envir=spatialreg:::.spatialregOptions)
[1] "cluster"      "cores"        "mc"           "rlecuyerSeed" "verbose"     
[6] "zeroPolicy"  
> library(parallel)
> nc <- max(2L, detectCores(logical=FALSE), na.rm = TRUE)-1L
> nc
[1] 63
> # set nc to 1L here
> if (nc > 1L) nc <- 1L
> #nc <- ifelse(nc > 2L, 2L, nc)
> coresOpt <- get.coresOption()
> coresOpt
NULL
> if (!is.na(nc)) {
+  invisible(set.coresOption(nc))
+  print(exists("mom_calc"))
+  if(.Platform$OS.type == "windows") {
+ # forking not permitted on Windows - start cluster
+ # removed for Github actions 210502
+ ## Not run: 
+ ##D   print(get.mcOption())
+ ##D   cl <- makeCluster(get.coresOption())
+ ##D   print(clusterEvalQ(cl, exists("mom_calc")))
+ ##D   set.ClusterOption(cl)
+ ##D   clusterEvalQ(get.ClusterOption(), library(spatialreg))
+ ##D   print(clusterEvalQ(cl, exists("mom_calc")))
+ ##D   clusterEvalQ(get.ClusterOption(), detach(package:spatialreg))
+ ##D   set.ClusterOption(NULL)
+ ##D   print(clusterEvalQ(cl, exists("mom_calc")))
+ ##D   stopCluster(cl)
+ ## End(Not run)
+  } else {
+   mcOpt <- get.mcOption()
+   print(mcOpt)
+   print(mclapply(1:get.coresOption(), function(i) exists("mom_calc"),
+    mc.cores=get.coresOption()))
+   invisible(set.mcOption(FALSE))
+   cl <- makeCluster(nc)
+   print(clusterEvalQ(cl, exists("mom_calc")))
+   set.ClusterOption(cl)
+   clusterEvalQ(get.ClusterOption(), library(spatialreg))
+   print(clusterEvalQ(cl, exists("mom_calc")))
+   clusterEvalQ(get.ClusterOption(), detach(package:spatialreg))
+   set.ClusterOption(NULL)
+   print(clusterEvalQ(cl, exists("mom_calc")))
+   stopCluster(cl)
+   invisible(set.mcOption(mcOpt))
+  }
+  invisible(set.coresOption(coresOpt))
+ }
[1] TRUE
[1] TRUE
[[1]]
[1] TRUE

Error in serverSocket(port = port) : 
  creation of server socket failed: port 11749 cannot be opened
Calls: makeCluster -> makePSOCKcluster -> serverSocket
Execution halted
Examples with CPU (user + system) or elapsed time > 5s
           user system elapsed
ML_models 4.179  0.014   7.441