Commit Graph

159 Commits

Author SHA1 Message Date
Preetha Appan
19777b870b linting fixes 2019-01-12 10:38:20 -06:00
Preetha Appan
c66f2abefd Make unit test for allocrunner failure much nicer 2019-01-12 10:38:20 -06:00
Preetha Appan
a1a7a02e48 Add unit test to simulate alloc runner creation failure 2019-01-12 10:38:20 -06:00
Michael Schurter
a20ae598c7 Apply suggestions from code review
Co-Authored-By: preetapan <preetha@hashicorp.com>
2019-01-12 10:38:20 -06:00
Preetha Appan
72dead7448 REfactor statedb factory config to set it directly in client config 2019-01-12 10:38:20 -06:00
Preetha Appan
80919bf713 Modified destroy failure handling to rely on allocrunner's destroy method
Added a unit test with custom statedb implementation that errors, to
use to verify destroy errors
2019-01-12 10:37:12 -06:00
Mahmood Ali
1b7b70f47e tests: enable and fix tests requiring mock driver 2019-01-10 10:10:11 -05:00
Mahmood Ali
76d40947d7 Merge pull request #5159 from hashicorp/r-macos-tests
Fix Travis MacOS job
2019-01-09 08:22:30 -05:00
Mahmood Ali
8a96bf84a1 tests: fix a test job constaints failing in macOS
Allow scheduling mock job when running on MacOS (or Windows) hosts.
2019-01-08 12:37:42 -05:00
Mahmood Ali
7b3ff40d22 run gofmt 2019-01-08 11:15:38 -05:00
Michael Schurter
f2e8375e35 test: re-eanble periodic fingerprint test 2018-12-19 17:08:24 -08:00
Michael Schurter
d5f4de38f8 client: assert alloc status updates work
Re-enabling and updating an old test. Able to cut out a ton of extra
work by using WaitForRunning which does almost everything this test
needs.
2018-12-19 11:41:53 -08:00
Nick Ethier
12528cadda drivermanager: attempt to reattach and shutdown driver plugin if blocked by allow/block lists 2018-12-18 23:01:57 -05:00
Danielle Tomlinson
f619db297f client: Update tests for async destroy 2018-12-18 23:38:34 +01:00
Mahmood Ali
cae36e49a6 client: update driver info on new fingerprint
Fixes a bug where a driver health and attributes are never updated from
their initial status.  If a driver started unhealthy, it may never go
into a healthy status.
2018-12-11 14:25:10 -05:00
Danielle Tomlinson
da48a7eab3 client: Move fingerprint structs to pkg
This removes a cyclical dependency when importing client/structs from
dependencies of the plugin_loader, specifically, drivers. Due to
client/config also depending on the plugin_loader.

It also better reflects the ownership of fingerprint structs, as they
are fairly internal to the fingerprint manager.
2018-12-01 17:10:39 +01:00
Danielle Tomlinson
c36bc2ce9b client: Remove test dependency on client/driver 2018-11-30 10:46:13 +01:00
Mahmood Ali
fd49039f09 address review comments 2018-11-16 17:13:01 -05:00
Mahmood Ali
58cbafe913 Populate alloc stats API with device stats
This change makes few compromises:

* Looks up the devices associated with tasks at look up time.  Given
that `nomad alloc status` is called rarely generally (compared to stats
telemetry and general job reporting), it seems fine.  However, the
lookup overhead grows bounded by number of `tasks x total-host-devices`,
which can be significant.

* `client.Client` performs the task devices->statistics lookup.  It
passes self to alloc/task runners so they can look up the device statistics
allocated to them.
  * Currently alloc/task runners are responsible for constructing the
entire RPC response for stats
  * The alternatives for making task runners device statistics aware
don't seem appealing (e.g. having task runners contain reference to hostStats)

* On the alloc aggregation resource usage, I did a naive merging of task device statistics.
  * Personally, I question the value of such aggregation, compared to
costs of struct duplication and bloating the response - but opted to be
consistent in the API.
  * With naive concatination, device instances from a single device group used by separate tasks in the alloc, would be aggregated in two separate device group statistics.
2018-11-16 10:26:32 -05:00
Mahmood Ali
04ecb5c72a Track Node Device attributes and serve them in API 2018-11-14 14:42:29 -05:00
Mahmood Ali
6b8c6836a9 Prioritize checking consumer context cancellation
Tests expect that as soon as eventer shuts down immediately on context
cancellations; but golang does not guarantee priority when multiple
pending channels are ready in a select statement.
2018-11-13 10:21:40 -05:00
Mahmood Ali
f9295631c4 Set clean config for mock driver
The default job here contains some exec task config (for setting
command and args) that aren't used for mock driver.  Now, the alloc
runner seems stricter about validating fields and errors on unexpected
fields.

Updating configs in tests so we can have an explicit task config
whenever driver is set explicitly.
2018-11-13 10:21:40 -05:00
Michael Schurter
e029980b25 tests: explicitly cleanup after clients 2018-10-17 10:06:59 -07:00
Nick Ethier
4f9522dd54 client: review comments and fixup/skip tests 2018-10-16 16:56:56 -07:00
Alex Dadgar
9a2c2a4f68 client uses passed logger and fix fingerprinters 2018-10-16 16:53:30 -07:00
Alex Dadgar
40d095fd1a agent + consul 2018-09-13 10:43:40 -07:00
Alex Dadgar
98c7abe541 Tests only use testlog package logger 2018-06-13 15:40:56 -07:00
Alex Dadgar
a62e412b88 Refactor - wip 2018-06-12 10:23:45 -07:00
Chelsea Holland Komlo
1a854c444e add server join info to server and client 2018-05-31 10:50:03 -07:00
Michael Schurter
29da24b77b test: build with mock_driver by default
`make release` and `make prerelease` set a `release` tag to disable
enabling the `mock_driver`
2018-04-18 14:45:33 -07:00
Chelsea Holland Komlo
228a2319c2 delete driver name from only health check attributes 2018-04-12 18:24:41 -04:00
Alex Dadgar
d0605c5229 Fix tests 2018-04-12 14:29:30 -07:00
Charlie Voiselle
c728a2feb8 Changed "til" to "until"
Should be "till" or "until"; chose "until" because it is unambiguous as to meaning.
2018-04-11 12:36:28 -05:00
Alex Dadgar
12ec2e3b60 RPC Retry Watcher 2018-04-03 18:05:28 -07:00
Chelsea Holland Komlo
115d54cb19 fix up health check logic comparison; add node events to client driver checks 2018-03-21 15:15:26 -04:00
Chelsea Holland Komlo
8a0ed4e5ff improve tests 2018-03-21 15:15:26 -04:00
Chelsea Holland Komlo
865b7e0ace fix up racy tests 2018-03-21 15:15:26 -04:00
Chelsea Holland Komlo
1570972cb3 add concept of health checks to fingerprinters and nodes
fix up feedback from code review

add driver info for all drivers to node
2018-03-21 15:15:25 -04:00
Chelsea Holland Komlo
29696110b2 add network resources equal method, use time ticker
remove impossible test case
2018-02-27 12:42:53 -05:00
Chelsea Holland Komlo
cd5be3bea9 improved testing; node networks comparison 2018-02-26 15:55:38 -05:00
Chelsea Holland Komlo
4271123b4f code review fixups 2018-02-26 12:36:30 -05:00
Chelsea Holland Komlo
7246c9d1ff edge trigger node update
test update config copy trigger
2018-02-26 12:36:04 -05:00
Alex Dadgar
efa8bc0615 Fix original client server list behavior 2018-02-15 16:04:53 -08:00
Alex Dadgar
e2d1ce8ff2 Fix manager tests and make testagent recover from port conflicts 2018-02-15 13:59:01 -08:00
Alex Dadgar
b97b44a76f use server manager 2018-02-15 13:59:01 -08:00
Alex Dadgar
a6baf7133a Remove testing 2018-02-15 13:59:01 -08:00
Alex Dadgar
d15bb76538 Refactor 2018-02-15 13:59:00 -08:00
Alex Dadgar
1611fe56e3 Add testing interfaces 2018-02-15 13:59:00 -08:00
Alex Dadgar
ddee97ca29 Stats Endpoint 2018-02-15 13:59:00 -08:00
Chelsea Holland Komlo
12ee25d852 extract test helper
lock concurrent accesses to node

comment exported method
2018-02-12 18:30:10 -05:00