Skip to content

Commit

Permalink
systemschema_test: fix timestamp stripping regex
Browse files Browse the repository at this point in the history
The test in this package was flaky because hlc.Timestamp values inside
descriptors (modification time, for instance) with a logical component
would be improperly redacted. This commit fixes this.

Fixes #85799.

Release note: None
  • Loading branch information
Marius Posta committed Aug 10, 2022
1 parent 6e0b2f2 commit caec19c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/sql/catalog/systemschema_test/systemschema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestValidateSystemSchemaAfterBootStrap(t *testing.T) {
defer leaktest.AfterTest(t)()

ctx := context.Background()
wallTimeRE, err := regexp.Compile(`"wallTime":"\d*"`)
hlcRE, err := regexp.Compile(`"wallTime":"\d*"(,"logical":\d*)?`)
require.NoError(t, err)

datadriven.Walk(t, testutils.TestDataPath(t, "bootstrap"), func(t *testing.T, path string) {
Expand Down Expand Up @@ -114,7 +114,7 @@ func TestValidateSystemSchemaAfterBootStrap(t *testing.T) {
require.NotNilf(t, ev.Desc, "unexpectedly missing descriptor in %s", ev)
str, err := je.MarshalToString(ev.Desc)
require.NoError(t, err, "unexpected descriptor marshal error")
str = wallTimeRE.ReplaceAllString(str, `"wallTime":"0"`)
str = hlcRE.ReplaceAllString(str, `"wallTime":"0"`)
sb.WriteString(str)
sb.WriteRune('\n')
}
Expand Down

0 comments on commit caec19c

Please sign in to comment.