Commit Graph

50 Commits

Author SHA1 Message Date
James Phillips 59a599a14b
Cleans up a stray mark and fixes unit tests.
Ended up removing the leader_test.go server address change test as part
of this. The join was failing becase we were using a new node name with
the new logic here, but realized this was hitting some of the memberlist
conflict logic and not working as we expected. We need some additional
work to fully support address changes, so removed the test for now.
2017-03-27 01:28:54 -07:00
James Phillips 4d3f3ea8d2
Changes verson 8 ACLs to opt-out. 2017-03-24 12:12:24 -07:00
James Phillips 15e7247131
Fixes test server startup returning wrong error.
Seen in https://travis-ci.org/hashicorp/consul/builds/214521317.
2017-03-23 21:40:14 -07:00
Seth Vargo 1dc1f72fb6
Add RPC 2017-03-23 18:41:20 -04:00
Seth Vargo 3d830b3676
Reduce coupling with testing.T
This reduces the coupling with testing.T, allowing many of the
server's startup-related functions to return an error. This makes them
more re-usable.
2017-03-23 18:41:19 -04:00
Kyle Havlovitz 9b4497de09
Cleaned up and reorganized some autopilot-related code 2017-03-09 18:21:40 -08:00
Kyle Havlovitz f389b59fd5
Fix up command and api tests 2017-02-28 14:12:55 -08:00
Jeff Mitchell 44733caf5c Update unix dial functions to use DialContext with new go-cleanhttp 2017-02-10 21:11:21 -05:00
James Phillips 14c6d009cc Drop testutil wait to 2 seconds.
There's likely a race (related to https://github.com/hashicorp/consul/issues/2644) where the catalog update might be in but the leader tracking doesn't report a leader, so this blocks forever and then times out. As a workaround we can lower the query wait time to always allow for a few retries.
2017-02-06 11:52:00 -08:00
James Phillips dcff5137f9
Adds a little wait after we get the event we were seeking. 2017-01-26 22:15:54 -08:00
James Phillips 8493d239ac
Run the waited-for function before sleeping, and ramp up the sleep exponentially. 2017-01-26 17:11:16 -08:00
James Phillips 8c33ddbee2
Drops the unit test wait time back down and turns initial wait into blocking query. 2017-01-26 16:57:44 -08:00
Seth Vargo c0b6c7ad3e
Check to see if TaggedAddresses have been populated
This ensures the node's anti-entropy checks have finished before
telling the client Consul is ready.
2017-01-26 00:13:03 -05:00
Seth Vargo 624b7daba4 Omit empty node_meta 2017-01-17 20:17:20 -05:00
Kyle Havlovitz f48f105949
Minor formatting tweaks as a follow-up to #2654 2017-01-17 19:20:29 -05:00
Seth Vargo 8bcfa9d3cc Do not skip tests when Consul is missing
This bit me on CI. The current behavior of the testutil server is to skip if consul isn't present. When lots of output is scrolling by, you're likely to miss the message that the test was skipped. Instead, I propose that we hard fatal if consul doesn't exist, and upstream consumers can skip the tests if they want.
2017-01-17 14:57:57 -05:00
Kyle Havlovitz 87c0283bb1
Update client api and docs for node metadata 2017-01-11 19:28:58 -05:00
Seth Vargo 9010b0e0f4
Use a random port instead of idx in testutil
The testutil server uses an atomic incrementer to generate unique port
numbers. This works great until tests are run in parallel, _across
packages_. Because each package starts at the same "offset" idx, they
collide.

One way to overcome this is to run each packages' test in isolation, but
that makes the test suite much longer as it does not maximize
parallelization. Alternatively, instead of having "predictable" ports,
we can let the OS choose a random open port automatically.

This still has a (albeit smaller) race condition in that the OS could
return an open port twice, before the server has a chance to actually
start and occupy said port. In practice, I have not been able to hit
this race condition, so it either doesn't happen or it happens far less
frequently that the existing implementation.

I'm not sure how I feel about the panic, but this is just test code, so
I'm including to say it's okay?
2016-12-01 17:24:26 +02:00
Kyle Havlovitz bd69c6d871 Add reload/leave http endpoints (#2516) 2016-11-30 13:29:42 -05:00
Kyle Havlovitz dd3368c19e Add keyring http endpoints 2016-11-22 20:10:43 -05:00
James Phillips 57db4bcce6
Adds performance tuning capability for Raft, detuned defaults, and supplemental docs. 2016-08-24 21:58:37 -07:00
Sean Chittenden e63d3a1275 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
kaskavalci 556f20b8c3 Make testutil.TestServer work correctly on Windows. 2016-04-15 15:44:30 +03:00
James Phillips 7510f00100 Merge pull request #1846 from TeaBough/master
Define a TestingT interface in server.go
2016-03-19 08:56:46 -07:00
Miquel Sabaté Solà 615c93a77d Used 'unconvert' to remove unneeded conversions
I've removed unneeded conversions by performing the following commands:

    $ go get -u github.com/mdempsky/unconvert
    $ go list ./... | grep -v vendor | xargs unconvert -apply

Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
2016-03-18 16:12:56 +01:00
Thibault Vigouroux 44bce6797f Define a TestingT interface in server.go 2016-03-18 12:27:59 +01:00
Jeff Mitchell 1e3840b044 Update cleanhttp repo location 2015-10-22 14:14:22 -04:00
Jeff Mitchell 9a5fd5424a Use cleanhttp to get rid of DefaultTransport 2015-10-22 10:47:50 -04:00
Jeff Mitchell f49fc095ef Don't use http.DefaultClient
Two of the changes are in tests; the one of consequence is in the API.
As explained in #1308 this can cause conflicts with downstream programs.

Fixes #1308.
2015-10-15 17:49:35 -04:00
Dale Wijnand 5a28ebcaa3 Fix a bunch of typos. 2015-09-15 13:22:08 +01:00
Robert Gogolok db18eb9fa2 testutil: support ACLMasterToken, ACLDatacenter and ACLDefaultPolicy 2015-06-11 11:25:05 +02:00
Seth Vargo fb879a37b5 Allow the user to control the output of the test server 2015-06-08 10:16:11 -04:00
Ryan Uber 480c189d9a testutil: key leader wait on bootstrap flag 2015-05-08 18:16:35 -07:00
Ryan Uber 04d73628d1 testutil: allow skipping leader wait, update example 2015-05-08 18:11:25 -07:00
Ryan Uber b48e4a21f6 testutil: error instead of panic 2015-04-22 20:35:27 -07:00
Ryan Uber a0e3b10a19 Change node name based on idx 2015-03-30 23:45:44 -07:00
Ryan Uber d6ce64b472 testutil: add ListKV method 2015-03-23 22:47:34 -07:00
Ryan Uber 4c42754886 testutil: disable checkpoint, fix waitForLeader 2015-03-23 19:27:59 -07:00
Ryan Uber 79029c63f2 testutil: bind to localhost address 2015-03-23 18:59:45 -07:00
Ryan Uber 1d0aea86ab testutil: helpers return responses 2015-03-21 06:45:26 -07:00
Ryan Uber 6f2dac6c30 testutil: test server supports domain sockets 2015-03-19 17:44:04 -07:00
Ryan Uber ed32eb3917 testutil: support retrieving kv pairs 2015-03-19 17:03:07 -07:00
Ryan Uber 63f05b1c56 testutil: support joining and specifying datacenters 2015-03-19 17:03:07 -07:00
Ryan Uber fa7414e276 testutil: Use HTTPAddr 2015-03-19 17:03:07 -07:00
Ryan Uber 8ea04bbb3f testutil: server comments 2015-03-19 17:03:07 -07:00
Ryan Uber c6cebc2b91 testutil: Support creating additional checks 2015-03-19 17:03:07 -07:00
Ryan Uber 313f89439e testutil: allow creation of services 2015-03-19 17:03:06 -07:00
Ryan Uber 576c49eaf0 testutil: working on helpers 2015-03-19 17:03:06 -07:00
Ryan Uber 78f9f53bf1 testutil: exposing the API address from the test server 2015-03-19 17:03:06 -07:00
Ryan Uber 37f6301856 testutil: initial pass at moving test server harness into testutil 2015-03-19 17:03:06 -07:00