Commit Graph

42 Commits

Author SHA1 Message Date
Frank Schroeder 5bbef3b47e Revert "test: Run command/agent tests in parallel"
This reverts commit 17be40a73310e1a0d2461b175f6214381ac41039.
2017-04-27 14:39:04 -07:00
Frank Schroeder 58e0b5cb70 test: Run command/agent tests in parallel 2017-04-27 10:34:30 -07:00
Frank Schroeder 9f8f258d4d Remove duplicate constants
This patch removes duplicate internal copies of constants in the structs
package which are also defined in the api package. The api.KVOp type
with all its values for the TXN endpoint and the api.HealthXXX constants
are now used throughout the codebase.

This resulted in some circular dependencies in the testutil package
which have been resolved by copying code and constants and moving the
WaitForLeader function into a separate testrpc package.
2017-04-20 09:54:49 -07:00
Seth Vargo 2efa3bdff8
Use new APIs 2017-03-23 18:48:13 -04:00
Yakau Bubnou 5c210fb25d Concurrent-safe notification mock
This patch provides additional attribute to the notification mock in
order to protect an access to the internal maps from multiple
go-routines. This is required to prevent panic errors caused by
inconsistent map state.
2016-12-07 19:31:44 +03:00
James Phillips 739f91ad6a Removes stale reference to reap lock which causes a panic. (#2490) 2016-11-09 09:52:07 -08:00
Kyle Havlovitz 5a3996af61 Add WaitForResult to some flaky tests (#2477)
This replaces some hard sleeps with testutil.WaitForResult retry
logic in some recently added tests around TLSSkipVerify in checks.
2016-11-04 21:55:55 -07:00
Kyle McCullough 697ea0f8eb Add setting to skip ssl certificate verification for HTTP checks (#1984)
* http check: add setting to skip ssl certificate verification

* update http check documentation

* fix typo in documentation

* Add TLSSkipVerify to agent api
2016-11-03 13:17:30 -07:00
Kyle Havlovitz d5ee327fea More flaky unit test fixes (#2449)
* More flaky unit test fixes
* Raise some test timeouts that were too low
2016-10-31 09:59:20 -07:00
Sean Chittenden ff45f8c8ff
Revert "Move `structs.CheckID` to a new top-level package, `types`."
This reverts commit 2bbd52e3b44ff1b60939a8400264d534662d6d51.
2016-06-07 16:59:02 -04:00
Sean Chittenden a4554b945c
Move `structs.CheckID` to a new top-level package, `types`.
Per discussion w/ @slackpad, move this type to its own top-level package
2016-06-07 16:59:02 -04:00
Sean Chittenden cd68cd3868
Move `structs.CheckID` to a new top-level package, `types`.
Per discussion w/ @slackpad, move this type to its own top-level package
2016-06-07 16:59:02 -04:00
Sean Chittenden 0857e93d0b
Float a type balloon. Some strings are square pegs in round holes.
This experiment was brought about because of variable naming
confusion where name and checkIDs were interchanged.  Gave CheckID
an Qualified Type Name and chased downstream changes.
2016-06-07 16:59:02 -04:00
James Phillips 03b0c196e0 Merge pull request #1762 from mshean/script-timeout
Add Timeout field to CheckMonitor
2016-04-24 23:08:06 -07:00
Sean Chittenden 65f9017c63 Update Check API to use constants
Use constants where appropriate to advocate their use.  Also add a deprecation notice re: `updateTTL`.
2016-04-23 16:01:59 -07:00
Matt Shean 7e617d6086 add Timeout field to CheckMonitor 2016-04-20 11:41:30 -07:00
Ryan Uber 9e82074f49 agent: limit HTTP check output to 4k 2016-04-14 14:28:07 -07:00
James Phillips d709ef537b Retains the last output when a TTL check times out. 2016-03-02 17:58:01 -08:00
James Phillips d22fe5ba62 Adds support for the reap lock. 2016-01-12 21:10:25 -08:00
James Phillips 23536f2b97 Adds Docker checks support to client API.
Also changed `DockerContainerId` to `DockerContainerID`, and updated the agent
API docs to reflect their support for Docker checks.
2015-11-18 07:40:02 -08:00
Diptanu Choudhury fb0cae7320 Forcing the Env variable to empty while testing the default shell logic 2015-10-26 20:35:13 -07:00
Diptanu Choudhury 9070d12b2f Added a test for selecting shell from env 2015-10-26 20:21:50 -07:00
Diptanu Choudhury f8a03508ad Fixed the tests 2015-10-26 18:20:02 -07:00
Diptanu Choudhury 15ff470a79 Added a test to check if we are properly truncating docker exec outputs 2015-10-26 18:06:55 -07:00
Diptanu Choudhury 709b518d03 Added a test for exit code 1 with docker exec 2015-10-26 16:58:09 -07:00
Diptanu Choudhury c8c08586f0 Fixed the Fake Docker client to simulate Exec start failures 2015-10-26 16:54:51 -07:00
Diptanu Choudhury f445318732 Added some tests for docker check 2015-10-26 12:59:40 -07:00
Peter Fern 86edd7169c Add TCP check type
Adds the ability to simply check whether a TCP socket accepts
connections to determine if it is healthy.  This is a light-weight -
though less comprehensive than scripting - method of checking network
service health.

The check parameter `tcp` should be set to the `address:port`
combination for the service to be tested.  Supports both IPv6 and IPv4,
in the case of a hostname that resolves to both, connections will be
attempted via both protocol versions, with the first successful
connection returning a successful check result.

Example check:

```json
{
  "check": {
    "id": "ssh",
    "name": "SSH (TCP)",
    "tcp": "example.com:22",
    "interval": "10s"
  }
}
```
2015-07-24 14:06:05 +10:00
Ryan Uber 589a4cc4c7 agent: disable HTTP keepalives for checks 2015-03-15 13:30:50 -07:00
arnaud briche 49a9836be3 - add tests for CheckHTTP with new timeout parameter && CheckType.Timeout parsing 2015-02-02 15:30:44 +07:00
Ryan Uber adb3bd4c5e agent: make check tests more reliable 2015-01-23 16:07:20 -08:00
Nicholas Capo b631c74ac2 command/agent: Add tests for HTTP Check 2015-01-13 00:09:42 +00:00
Ryan Breen b97a35234d Clean up log line and reduce test time. 2014-12-18 09:00:51 -05:00
Ryan Breen d415219cd5 Test that staggered checks run within the defined interval. 2014-12-17 22:39:11 -05:00
Nelson Elhage 63c96627df tests: Don't generate binary output from checks.
The tests will end up logging the check output, and spewing random
binary all over a terminal never results in anything good.
2014-05-26 13:23:10 -07:00
William Tisäter d199dcde9b Run checks more often in `expectStatus` 2014-05-09 03:41:10 +02:00
William Tisäter 95f2597fe9 Fix race condition in `TestCheckTTL`
Apparently the execution of `TestCheckTTL` could sometime take > 10ms
causing it to fail. This commit will eliminate the race condition for
most modern hardware.
2014-05-06 20:54:49 +02:00
Armon Dadgar d1889a6f4b agent: Limit health check output to 4K. Fixes #83. 2014-04-29 15:28:56 -07:00
Armon Dadgar 1ebb6db8c1 Seperate localState from Agent 2014-01-21 11:52:25 -08:00
Armon Dadgar f8a0a3706f Allow setting the health check notes 2014-01-20 17:19:20 -10:00
Armon Dadgar c7d8b1dc75 Adding CheckTTL for TTL based checks 2014-01-20 17:12:40 -10:00
Armon Dadgar 714df8f9b3 Testing the CheckMonitor 2014-01-20 16:58:05 -10:00