Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
e2e: ensure schemas have ranges that land on all nodes
in order for the newenemy test to work, we need to ensure that the additional reads for namespaces that have been added for namespace versioning do not re-sync timestamps across cockroach nodes. by first filling the datastore with a large number of namespaces, we can pick one that has a range leader on the slow node, so that future writes to the slow node don't involve reads from other nodes the core of the test is otherwise the same, though extra machinery for reasoning about range leaders was added
- Loading branch information
Showing
11 changed files
with
410 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package generator | ||
|
||
import "github.com/brianvoe/gofakeit/v6" | ||
|
||
type UniqueGenerator struct { | ||
seen map[string]struct{} | ||
regex string | ||
} | ||
|
||
func NewUniqueGenerator(regex string) *UniqueGenerator { | ||
return &UniqueGenerator{ | ||
seen: make(map[string]struct{}, 0), | ||
regex: regex, | ||
} | ||
} | ||
|
||
func (g *UniqueGenerator) Next() string { | ||
for { | ||
val := gofakeit.Regex(g.regex) | ||
if _, ok := g.seen[val]; !ok { | ||
g.seen[val] = struct{}{} | ||
return val | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.