Commit graph

30 commits

Author SHA1 Message Date
Matthew Jaffee
da4a42dfe9 use separate qcx for write/read in test
now that min/max queries don't use a write Tx it seems we need to
separate read and write in the tests. Not sure I 100% understand this.

(cherry picked from commit a58299def4)
2023-01-10 23:22:58 +00:00
Kasey Rodgers
e75abc3c38 added testify dependency 2022-09-30 11:31:37 -07:00
Seebs
6b008beaec address multiple staticcheck issues
staticcheck notices a bunch of unused values and similar
things, let's fix them while we're here.
2022-09-30 11:25:27 -07:00
Seebs
ea69b0637d significant refactor of test setup and teardown
We centralize the creation paths for test indexes, fields,
etcetera so they all have a common path, all using standard
test holders. There's still two versions, one for test.* functions
and one for internal. They do share a TestHolderConfig though.

Large hunks of the related APIs are simplified/streamlined.
* Fragments are always created with a Field and don't need
  a workaround in case they don't have it.
* Creation of test fragments, etc., use optional FieldOptions
  but don't specify names because they're all using new holders
  for each thing created anyway. This dramatically reduces
  the complexity of the calls.
* test fragments are created inside test views which are created
  inside test fields, etcetera, so everything is using the same
  logic; test views aren't bypassing the other layers, they're
  creating themselves normally within a field.
* Quite a few things now use the standard runtime/production
  logic instead of being custom workarounds; for instance, instead
  of `mustOpenMutexFragment` creating a fragment and then creating
  a mutex vector for it, we just create a mutex-typed field and
  have the normal runtime code do this.
* Similarly, we now use the same field creation logic that production
  does, instead of having our own test-only thing that validates
  field names directly, so our test that we're validating field names
  is actually testing the runtime code. Yay.
* fragSpec goes away. it was a replacement for fragProxy which existed
  to solve memory allocation problems but replaced them with interface
  overhead problems. Now we just have pointers to things and maintain
  valid data structures.
* Many panics are now Fatal or Fatalf calls.
* Some specific bugs fixed, like a cluster which was requested and
  then had its first node directly overwritten, which isn't valid with
  shared clusters.
* Drop the temp-dir test flag and TempDir variable, we can just use
  $TMPDIR.
* Drop a benchmark of "write file to disk" that was purely a benchmark
  of file write speed, not a benchmark of rendering the data that needs
  to be written.
* Drop the unused "flags" parameter to fragment creation, which was
  only used back when we changed the BSI format.
* Use holder.Txf() rather than index.Txf(). The TxFactory has to be
  holder-level anyway, referring to it via the index is misleading.
* Test holders automatically close themselves and delete themselves,
  we remove various other things that thought they were responsible
  for deleting themselves.
2022-09-30 11:25:27 -07:00
Seebs
964e7d86c8 kill everything that tries to pass nil tx to field/view things
The "field/view will just synthesize a tx" behavior is awful and
also hides a number of fundamental flaws. We distinguish between
"we really do mean to work on a single shard here" and "we intend
to work on the whole field or view", and the latter now take
Qcx instead of Tx.

This eliminates a lot of very weird cases where we checked for
nil Tx and synthesized them, and also gets us away from
field and view taking Tx parameters when no possible Tx
can be constructed which is valid, because Tx are inherently
shard-specific at this time.
2022-09-30 11:10:47 -07:00
Fletcher Haynes
da9b57bd45 Updated dependency paths to reflect new repo location 2022-09-06 09:39:22 -07:00
Fletcher Haynes
eb06bb50ae Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
Kuba Podgórski
9cdaff542f
Update field_internal_test.go 2020-04-09 15:04:34 +02:00
Kuba Podgórski
4272693641
Update field_internal_test.go 2020-04-09 15:04:11 +02:00
Kuba Podgórski
b43065625a
Merge branch 'master' into cache-size-none 2020-04-09 12:37:44 +02:00
Travis Turner
4fb0712dab
add a test for pilosa/#2084 2019-11-12 12:05:36 -06:00
Travis
4af91faa7e
fix cacheSize when cacheType is none (and cacheSize is 0)
There was an edge case where setting cacheType to none
wouldn't zero out its cacheSize. This fixes that edge case.
2019-11-08 17:12:35 -06:00
Ben Johnson
c7c9c1e1d7
v2.0.0
Co-authored-by: Cody Soyland <codysoyland@gmail.com>
2019-10-08 14:56:17 -06:00
Travis Turner
c5140ba88d
default BSI base value to min, max, or 0 depending on the min/max range 2019-07-31 09:19:04 -05:00
Ben Johnson
d4de122549
Add min/max constraints 2019-05-17 15:52:17 -06:00
Ben Johnson
7ed9fba335
Unbounded BSI w/ sign magnitude
This commit implements BSI with variable bit depth using a
sign magnitudeto indicate whether a value is positive or negative.
This also rearranges the existence bit to be the first bit instead
of the last bit.
2019-05-17 15:52:17 -06:00
Seebs
77d49ded64 so much lint
So with the switch to a new linter, we get a lot of new warnings,
and the majority of them are harmless probably, but a few might be
real. Variously just use _ to suppress warnings, or report errors.
There's probably things here that deserve better fixes, but we can
always revisit it.
2019-04-16 12:07:18 -05:00
Matt Jaffee
fe7b926773
make sure more tests and benchmarks can have their temp dir set by flag
This is to allow the directory to be set to where a particular disk is mounted
during benchmarking.
2019-01-21 16:23:27 -06:00
Travis Turner
03e68aaa69 Update field_internal_test.go 2018-10-17 12:38:29 -05:00
Todd Gruben
829779f550 Merge remote-tracking branch 'upstream/master' into available-shard-bug 2018-10-17 12:11:24 -05:00
Todd Gruben
30059f9e7e force truncate of available shards file to avoid corruption 2018-10-17 12:06:54 -05:00
Ben Johnson
f8608227d1
Add DeleteAvailableShard()
This commit adds the ability to remove an 'available shard'
from the shard cache. This does not affect shards known to be
available because of local data.
2018-10-17 08:50:06 -06:00
Travis Turner
cdfcd6db5e
store remoteAvailableShards to file 2018-09-24 15:37:43 -05:00
Cody Soyland
3faa51544a Unexport Field.SetTimeQuantum 2018-07-05 23:11:56 -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
bc0fce99d5
fix MustSetBit and cleanup dead code 2018-07-03 08:53:16 -05:00
Matt Jaffee
2202bf467b
unexport view stuff 2018-07-02 17:18:00 -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
4182678d5a
work on unexporting View stuff 2018-07-02 10:11:56 -05:00
Travis Turner
0f8bd62e33
more Frame to Field in tests. move frame*.go files to field*.go 2018-06-05 23:58:46 -05:00
Renamed from frame_internal_test.go (Browse further)