# GTest timeouts

**URL:** https://discourse.itk.org/t/gtest-timeouts/1160
**Category:** Engineering
**Created:** [July 27, 2018, 3:47pm UTC](https://discourse.itk.org/t/gtest-timeouts/1160 "2018-07-27T15:47:26Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [July 27, 2018, 3:47pm UTC](https://discourse.itk.org/t/gtest-timeouts/1160/1 "2018-07-27T15:47:26Z")

</div>

I just updated ninja version 1.5.3 -\> 1.8.2 on dash5 (osx build machine for continuous integration testing). As the version was so old that might just be the reason for those frequent GTest timeouts. Let’s wait and see.

---

<div class="post-metadata">

### Author: ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)
#### Post date: [August 1, 2018, 7:26am UTC](https://discourse.itk.org/t/gtest-timeouts/1160/2 "2018-08-01T07:26:58Z")

</div>

Sounds promising. Let us know when there is some proof that this fixes the timeout issues we’ve been witnessing lately. Thanks @dzenanz

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [August 1, 2018, 1:13pm UTC](https://discourse.itk.org/t/gtest-timeouts/1160/3 "2018-08-01T13:13:08Z")

</div>

It should have already been noticeable, but it looks like that didn’t help much.

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [August 1, 2018, 1:24pm UTC](https://discourse.itk.org/t/gtest-timeouts/1160/4 "2018-08-01T13:24:22Z")

</div>

I am having a similar failure on the SimpleITK dashboard:  
[https://open.cdash.org/viewBuildError.php?buildid=5458556](https://open.cdash.org/viewBuildError.php?buildid=5458556)

The failure is related to a GTest, which uses CMake’s build time detection of GTest in a driver.

The system is running CMake 3.11.1, and just using the system GNU Makefile generator.

It appears to have begun failing on July 16.

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [August 1, 2018, 2:22pm UTC](https://discourse.itk.org/t/gtest-timeouts/1160/5 "2018-08-01T14:22:10Z")

</div>

A quick check of my failure showed that it took a really long time to link the offending executable.

The command line also revealed a variable pass “-D TEST\_DISCOVERY\_TIMEOUT=5”.

Does the ITK problematic executable take a long time to link? Does the executable need to be split in twine? Can we set this time out in cmake?

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [August 2, 2018, 3:34pm UTC](https://discourse.itk.org/t/gtest-timeouts/1160/6 "2018-08-02T15:34:29Z")

</div>

Here is a proposed patch which lengths the GTest discover timeout:  
[http://review.source.kitware.com/#/c/23608/](http://review.source.kitware.com/#/c/23608/)

The DISCOVERY\_TIMEOUT option was added in CMake 3.10, perhaps the default of 5 seconds is too short:  
[https://cmake.org/cmake/help/v3.10/module/GoogleTest.html](https://cmake.org/cmake/help/v3.10/module/GoogleTest.html)

There is a compatibility issue with CMake 3.10.2:

```auto
 In CMake versions 3.10.1 and 3.10.2, this option was called TIMEOUT. This clashed with the TIMEOUT test property, which is one of the common properties that would be set with the PROPERTIES keyword, usually leading to legal but unintended behavior. The keyword was changed to DISCOVERY_TIMEOUT in CMake 3.10.3 to address this problem. The ambiguous behavior of the TIMEOUT keyword in 3.10.1 and 3.10.2 has not been preserved.

```

I guess we are [stuck](https://packages.ubuntu.com/bionic/cmake) with 3.10.2.

@brad.king
