[testing] add timeout_decorator
This is a simple way to make sure code doesn't get slower over time. Since it is a new dependency, I wanted to show a tiny PR before I use it more.
Feels like it could be reimplemented in a few lines of code – do we need to add a new dependency for this?<|||||>I copy pasted it. Would love to understand more about the adding a dependency vs maintaining code tradeoff!<|||||>I think that's a great addition! Trying to keep the tests short is very important I think :-) <|||||>This is too long to copy/paste, so I'd see two options:
- add it as a dependency to extras["testing"]
- take just the signals based implem, clean it up/distill it down to a few (10) lines of code and add it in `tests/`<|||||>I think we should do `extras['testing']` (that was my first attempt on this PR).
If we delete the `signals=False` logic, I don't think circleci will work in distributed testing mode.<|||||># [Codecov](https://codecov.io/gh/huggingface/transformers/pull/3543?src=pr&el=h1) Report
> Merging [#3543](https://codecov.io/gh/huggingface/transformers/pull/3543?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/b8686174be75220d2c26a961597a39ef4921b616&el=desc) will **increase** coverage by `0.01%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/3543/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/3543?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master    #3543      +/-   ##
==========================================
+ Coverage   78.84%   78.85%   +0.01%     
==========================================
  Files         114      114              
  Lines       18691    18691              
==========================================
+ Hits        14737    14739       +2     
+ Misses       3954     3952       -2     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/3543?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/3543/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `92.93% <0.00%> (+0.16%)` | :arrow_up: |
| [src/transformers/trainer.py](https://codecov.io/gh/huggingface/transformers/pull/3543/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90cmFpbmVyLnB5) | `43.90% <0.00%> (+0.34%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/3543?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/3543?src=pr&el=footer). Last update [b868617...8b22919](https://codecov.io/gh/huggingface/transformers/pull/3543?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
