From 4c37eed884afe54cfed3f0157c5c1c155cede619 Mon Sep 17 00:00:00 2001 From: Andrew Werner Date: Mon, 31 Aug 2020 17:54:23 -0400 Subject: [PATCH 1/2] sql: fix TestTruncateCompletion 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 --- pkg/sql/schema_changer_test.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pkg/sql/schema_changer_test.go b/pkg/sql/schema_changer_test.go index 0c3ca29b9785..14660b7c7c37 100644 --- a/pkg/sql/schema_changer_test.go +++ b/pkg/sql/schema_changer_test.go @@ -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)) From 26e6b0897adced2ad6d964e508ef0f3c1aa61019 Mon Sep 17 00:00:00 2001 From: Rafi Shamim Date: Mon, 31 Aug 2020 18:11:05 -0400 Subject: [PATCH 2/2] roachtest: add expected passes to ORM tests, stabilize sqlalchemy Release note: None Release justification: test-only change --- pkg/cmd/roachtest/django.go | 4 +--- pkg/cmd/roachtest/pgjdbc_blocklist.go | 1 - pkg/cmd/roachtest/pgx_blocklist.go | 1 - pkg/cmd/roachtest/sqlalchemy.go | 2 +- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/cmd/roachtest/django.go b/pkg/cmd/roachtest/django.go index a573ffbdcd33..eb74217ec8ea 100644 --- a/pkg/cmd/roachtest/django.go +++ b/pkg/cmd/roachtest/django.go @@ -20,7 +20,6 @@ var djangoReleaseTagRegex = regexp.MustCompile(`^(?P\d+)\.(?P\d+)( var djangoCockroachDBReleaseTagRegex = regexp.MustCompile(`^(?P\d+)\.(?P\d+)$`) var djangoSupportedTag = "cockroach-3.0.x" -var djangoCockroachDBSupportedTag = "3.0.2" func registerDjango(r *testRegistry) { runDjango := func( @@ -127,7 +126,6 @@ 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, @@ -135,7 +133,7 @@ func registerDjango(r *testRegistry) { c, "https://github.com/cockroachdb/django-cockroachdb", "/mnt/data1/django/tests/django-cockroachdb", - djangoCockroachDBSupportedTag, + "master", node, ); err != nil { t.Fatal(err) diff --git a/pkg/cmd/roachtest/pgjdbc_blocklist.go b/pkg/cmd/roachtest/pgjdbc_blocklist.go index 4565e9c5a7fb..5ad2f8d7cdd9 100644 --- a/pkg/cmd/roachtest/pgjdbc_blocklist.go +++ b/pkg/cmd/roachtest/pgjdbc_blocklist.go @@ -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", diff --git a/pkg/cmd/roachtest/pgx_blocklist.go b/pkg/cmd/roachtest/pgx_blocklist.go index 252381b23d04..76a9f3b7f30d 100644 --- a/pkg/cmd/roachtest/pgx_blocklist.go +++ b/pkg/cmd/roachtest/pgx_blocklist.go @@ -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", diff --git a/pkg/cmd/roachtest/sqlalchemy.go b/pkg/cmd/roachtest/sqlalchemy.go index 13e7cd429d11..6c5929fd3b7f 100644 --- a/pkg/cmd/roachtest/sqlalchemy.go +++ b/pkg/cmd/roachtest/sqlalchemy.go @@ -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) }