Commit graph

187 commits

Author SHA1 Message Date
Kuba Podgórski
1f32fe05b0 Make not found error more verbose (add name) 2020-08-27 19:45:19 +02:00
Matt Jaffee
2651bfbd88
test and fix authentication of client certs btwn cluster nodes
This change should have been adding the "GetClientCertificate"
function in server/tlsconfig.go. This is in addition to the
GetCertificate func which is only used by servers. It ended up being
much more involved for a few reasons:

1. We had no way of passing a configured HTTP client into the
translate store stuff.

2. Our cluster tests assumed http, not HTTPS, and didn't have any way
to pass the necessary configuration in.

3. I encountered what turned out to be an unrelated bug in
cmd/server_test.go which is why I moved "close(m.Started)" in
server/server.go. Basically, I was running something on port 10111
which caused the test to fail (because it was trying to bind to that),
but the failure was not immediately caught during server startup
because the m.Started channel got closed which allowed the test code
to fall through to where it called m.Close() which then got a nil
pointer exception because m.Handler had never been set up.

4. Our test code was assuming that it could create clients that
ignored the config, which meant they didn't do TLS. I added an
InternalClient() method to pilosa.Server to expose the configured
client.
2019-10-18 15:17:35 -05:00
Ben Johnson
e844e1ad75
Translation store refactor 2019-10-09 08:59:41 -06:00
Ben Johnson
c7c9c1e1d7
v2.0.0
Co-authored-by: Cody Soyland <codysoyland@gmail.com>
2019-10-08 14:56:17 -06:00
Matt Jaffee
9a453ef51a
expose worker pool size to config, so we can set it lower in tests
we are experiencing issues with CI where it fails with race: limit on
8128 simultaneously alive goroutines is exceeded, dying

this, despite the fact that closing the executor should clean up all
worker goroutines. Apparently in CircleCI runtime.NumCPU() reports 36,
so the goroutines added up quickly.
2019-07-15 14:25:40 -05:00
Matt Jaffee
9e6662fb00
send POSTed schema to all nodes in cluster
also fix a *bunch* of tests that weren't closing the clusters they
created. Cleaned up one test to use t.Run instead of just checking
everything in a loop
2019-04-29 19:31:23 -05:00
Yuce Tekol
c30b03df14
trivial 2019-01-04 01:56:10 +03:00
Yuce Tekol
65c30283d7
adds tests for GroupBy with keys; removes unused Bit message from proto 2019-01-03 15:20:02 +03:00
Travis Turner
358c32a165
add test for translate store buffer growth logic. add max limit to buffer size. 2018-12-18 12:48:20 -06:00
Matt Jaffee
578c594755
convert GroupBy tests to use new utils; fix case where index exists 2018-10-09 19:13:12 -05:00
Matt Jaffee
45fb6f0c06
add some new test utils and test Rows calls on cluster 2018-10-09 18:44:48 -05:00
Cody Soyland
2521922d7b Properly wrap translation store errors, decrease test map size to prevent failure on 32-bit 2018-09-25 11:35:58 -05:00
Cody Soyland
52ba336461 Address code review feedback 2018-09-20 16:05:28 -05:00
Cody Soyland
2394d36108 Adjust tests, fix 32-bit config 2018-09-19 13:30:22 -05:00
Cody Soyland
7a32745b28 Make translate map size configurable. 2018-09-19 12:35:00 -05:00
Matt Jaffee
4ea48e1b40
remove unused log buffers from test cluster, fixes race
the buffers were unused internally and external users had no access to them.
Those wishing to read the logs of the cluster in tests may replace stdout/stderr
with buffers on the Command struct.

The race occurred when a node was stopped and then started again. some
memberlist goroutines might not be completely cleaned up by the time the node
restarted, and then two loggers were using the same output buffer.
2018-09-11 15:28:16 -05:00
Travis Turner
9b4c67ee60
rename notnull to exists 2018-09-11 15:15:37 -05:00
Travis Turner
a6f22eb8b3
replace *testing.T with interface testing.TB 2018-09-06 09:43:21 -05:00
Travis Turner
f1a460aca7
adds view parameter to sync logic for syncing time fields 2018-08-16 11:27:08 -05:00
Ben Johnson
a31a08c330
Support keys on import CLI. 2018-08-14 09:32:39 -05:00
Matt Jaffee
48af3adc21
add degraded cluster state and handle node failure
cluster is in degraded state when some number of nodes greater than 0 but less
than replicaN have failed. This is sort of a hybrid of "STARTING" and "NORMAL"
states because we can still respond to queries as in the NORMAL state, but we
need to be alert to re-add nodes to the cluster if they come back online which
required some changes to the cluster logic.

In order to make debugging easier, the test.MustRunCluster functionality now
names the nodes in the cluster explicitly as "node0", "node1", etc. "node0" is
the coordinator.

A number of TODOs are left in the test for scenarios that need to be checked.
2018-08-06 11:57:24 -05:00
Cody Soyland
dd7b5f517b
Merge branch 'master' into 1513-metalinter-megacheck 2018-08-02 10:29:47 -05:00
Travis Turner
dfd529b2f5
update parser to handle row keys on SetRowAttrs() 2018-07-27 10:50:04 -05:00
Cody Soyland
f01d850b17 Fix linter issues: gosimple 2018-07-20 09:06:43 -05:00
Cody Soyland
d4510172d3 Fix linter issues: ineffassign 2018-07-18 14:02:56 -05:00
Cody Soyland
f9625ef4fa Fix linter issues: unparam 2018-07-17 12:05:07 -05:00
Matt Jaffee
c2c1910671
fix comment typos 2018-07-10 16:38:55 -05:00
Matt Jaffee
b7e5f8842e
add a configurable timeout to http handler closing
refactor handler Close func to use errgroup to be a bit less messy.

refactor pilosa.Server closing to actually return an underlying error if one occurs

add option to pilosa/test.Cluster and pilosa/server.Command to control close
timeout. currently is only used by the http handler, but conceivably could be
passed as a parameter to other subsystems of pilosa/server.Command
2018-07-10 15:16:35 -05:00
Cody Soyland
c004ffba3e Unexport test.NewIndex 2018-07-05 23:11:56 -05:00
Cody Soyland
17d212444c Unexport test.NewField 2018-07-05 23:11:56 -05:00
Cody Soyland
8e026493a4 Unexport test.NewCommand 2018-07-05 23:11:56 -05:00
Cody Soyland
66771b6ccd Unexport test.MustOpenField 2018-07-05 23:11:56 -05:00
Cody Soyland
48730e722f Unexport test.Field.Reopen 2018-07-05 23:11:56 -05:00
Cody Soyland
9ddb881bed Unexport test.Field.Close 2018-07-05 23:11:56 -05:00
Cody Soyland
39504f8ded Unexport test.Command.Stderr 2018-07-05 23:11:56 -05:00
Cody Soyland
44e0659934 Unexport test.Command.Stdout 2018-07-05 23:11:56 -05:00
Cody Soyland
3aa759bff7 Unexport test.Command.Stdin 2018-07-05 23:11:56 -05:00
Cody Soyland
66df2cf126 Unexport test.BufferLogger 2018-07-05 23:11:56 -05:00
Cody Soyland
a0e23fa6be
Merge branch 'develop' into dead-code-removal 2018-07-05 16:59:31 -05:00
Cody Soyland
2b7d937df2
Merge branch 'develop' into remove-setupserver-calls 2018-07-05 15:36:38 -05:00
Cody Soyland
da4cd84820 Remove some dead code 2018-07-05 15:31:07 -05:00
Travis Turner
44f0b992f6
change all CreateField() methods to take functional options instead of FieldOptions 2018-07-04 21:22:35 -05:00
Matt Jaffee
7900e47f8a
Merge branch 'develop' into remove-setupserver-calls 2018-07-03 16:33:32 -05:00
Matt Jaffee
5ff77c816a
get rid of unecessary server stuff and export node and uri 2018-07-03 13:26:51 -05:00
Matt Jaffee
3781b6e7eb
remove redundant calls to SetupServer 2018-07-03 11:05:33 -05:00
Matt Jaffee
bc0fce99d5
fix MustSetBit and cleanup dead code 2018-07-03 08:53:16 -05:00
Matt Jaffee
5a9802c3b7
get rid of test.Holder.ViewRow, replace with more restricted RowTime 2018-07-02 17:08:33 -05:00
Matt Jaffee
cff01f46c2
unexport fragment.go stuff 2018-07-02 14:50:33 -05:00
Matt Jaffee
4182678d5a
work on unexporting View stuff 2018-07-02 10:11:56 -05:00
Matt Jaffee
95547a9a27
remove the last usages of test.NewExecutor and cleanup unused in test package 2018-07-01 07:31:31 -05:00