Skip to content

Commit

Permalink
Merge #53711 #53714
Browse files Browse the repository at this point in the history
53711: sql: fix TestTruncateCompletion r=rohany a=ajwerner

The table data is deleted asynchronously by the GC job. It's not obvious to me
why this wasn't flakey before. The work in #53589 to generally speed up job
adoption seems to have revealed the flake that I think existed before the
change. This test used to fail under stress 2 minutes. I've run it for 6
now and so far so good.

Release justification: non-production code changes

Release note: None

53714: roachtest: add expected passes to ORM tests, stabilize sqlalchemy r=rafiss a=rafiss

fixes #53598 

Release note: None
Release justification: test-only change

Co-authored-by: Andrew Werner <[email protected]>
Co-authored-by: Rafi Shamim <[email protected]>
  • Loading branch information
3 people committed Sep 1, 2020
3 parents f2056ba + 4c37eed + 26e6b08 commit 2d5cd11
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
4 changes: 1 addition & 3 deletions pkg/cmd/roachtest/django.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ var djangoReleaseTagRegex = regexp.MustCompile(`^(?P<major>\d+)\.(?P<minor>\d+)(
var djangoCockroachDBReleaseTagRegex = regexp.MustCompile(`^(?P<major>\d+)\.(?P<minor>\d+)$`)

var djangoSupportedTag = "cockroach-3.0.x"
var djangoCockroachDBSupportedTag = "3.0.2"

func registerDjango(r *testRegistry) {
runDjango := func(
Expand Down Expand Up @@ -127,15 +126,14 @@ func registerDjango(r *testRegistry) {
t.Fatal(err)
}
c.l.Printf("Latest django-cockroachdb release is %s.", djangoCockroachDBLatestTag)
c.l.Printf("Supported django-cockroachdb release is %s.", djangoCockroachDBSupportedTag)

if err := repeatGitCloneE(
ctx,
t.l,
c,
"https://github.com/cockroachdb/django-cockroachdb",
"/mnt/data1/django/tests/django-cockroachdb",
djangoCockroachDBSupportedTag,
"master",
node,
); err != nil {
t.Fatal(err)
Expand Down
1 change: 0 additions & 1 deletion pkg/cmd/roachtest/pgjdbc_blocklist.go
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,6 @@ var pgjdbcBlockList20_2 = blocklist{
"org.postgresql.test.jdbc2.ResultSetMetaDataTest.testUnexecutedStatement[databaseMetadataCacheFields = 0, databaseMetadataCacheFieldsMib = null]": "32565",
"org.postgresql.test.jdbc2.ResultSetMetaDataTest.testUnexecutedStatement[databaseMetadataCacheFields = null, databaseMetadataCacheFieldsMib = 0]": "32565",
"org.postgresql.test.jdbc2.ResultSetMetaDataTest.testUnexecutedStatement[databaseMetadataCacheFields = null, databaseMetadataCacheFieldsMib = null]": "32565",
"org.postgresql.test.jdbc2.ResultSetTest.testUpdateWithPGobject": "41781",
"org.postgresql.test.jdbc2.ResultSetTest.testgetBadBoolean": "32552",
"org.postgresql.test.jdbc2.SearchPathLookupTest.testSearchPathBackwardsCompatibleLookup": "26443",
"org.postgresql.test.jdbc2.SearchPathLookupTest.testSearchPathHiddenLookup": "26443",
Expand Down
1 change: 0 additions & 1 deletion pkg/cmd/roachtest/pgx_blocklist.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ var pgxBlocklist20_2 = blocklist{
"v4.TestConnQueryErrorWhileReturningRows": "26925",
"v4.TestConnQueryReadRowMultipleTimes": "26925",
"v4.TestConnQueryValues": "26925",
"v4.TestConnQueryValuesWithUnknownOID": "26925",
"v4.TestConnSendBatch": "44712",
"v4.TestConnSendBatchWithPreparedStatement": "41558",
"v4.TestConnSimpleProtocol": "21286",
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/roachtest/sqlalchemy.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func runSQLAlchemy(ctx context.Context, t *test, c *cluster) {

t.Status("installing sqlalchemy-cockroachdb")
if err := repeatRunE(ctx, c, node, "installing sqlalchemy=cockroachdb", `
cd /mnt/data1/sqlalchemy-cockroachdb && sudo python3 setup.py install
cd /mnt/data1/sqlalchemy-cockroachdb && sudo pip3 install .
`); err != nil {
t.Fatal(err)
}
Expand Down
13 changes: 8 additions & 5 deletions pkg/sql/schema_changer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4093,11 +4093,14 @@ CREATE TABLE t.test (k INT PRIMARY KEY, v INT, pi DECIMAL REFERENCES t.pi (d) DE
// Ensure that the table data has been deleted.
tablePrefix := keys.SystemSQLCodec.IndexPrefix(uint32(tableDesc.ID), uint32(tableDesc.PrimaryIndex.ID))
tableEnd := tablePrefix.PrefixEnd()
if kvs, err := kvDB.Scan(ctx, tablePrefix, tableEnd, 0); err != nil {
t.Fatal(err)
} else if e := 0; len(kvs) != e {
t.Fatalf("expected %d key value pairs, but got %d", e, len(kvs))
}
testutils.SucceedsSoon(t, func() error {
if kvs, err := kvDB.Scan(ctx, tablePrefix, tableEnd, 0); err != nil {
t.Fatal(err)
} else if e := 0; len(kvs) != e {
return errors.Errorf("expected %d key value pairs, but got %d", e, len(kvs))
}
return nil
})

fkTableDesc := catalogkv.TestingGetTableDescriptor(kvDB, keys.SystemSQLCodec, "t", "pi")
tablePrefix = keys.SystemSQLCodec.TablePrefix(uint32(fkTableDesc.ID))
Expand Down

0 comments on commit 2d5cd11

Please sign in to comment.