From c945186c392198f5154be5733cba48e630b17665 Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Thu, 3 Oct 2024 11:12:42 +0200 Subject: [PATCH] Allow non standard FK keys for stress tests Signed-off-by: Dirkjan Bussink --- .../workflows/cluster_endtoend_vtgate_foreignkey_stress.yml | 4 ++++ test/ci_workflow_gen.go | 4 ++++ test/templates/cluster_endtoend_test.tpl | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/.github/workflows/cluster_endtoend_vtgate_foreignkey_stress.yml b/.github/workflows/cluster_endtoend_vtgate_foreignkey_stress.yml index 3557274cd86..18e8f5cae27 100644 --- a/.github/workflows/cluster_endtoend_vtgate_foreignkey_stress.yml +++ b/.github/workflows/cluster_endtoend_vtgate_foreignkey_stress.yml @@ -135,6 +135,10 @@ jobs: set -exo pipefail + cat <<-EOF>>./config/mycnf/mysql84.cnf + restrict_fk_on_non_standard_key=OFF + EOF + # run the tests however you normally do, then produce a JUnit XML file eatmydata -- go run test.go -docker=false -follow -shard vtgate_foreignkey_stress | tee -a output.txt | go-junit-report -set-exit-code > report.xml diff --git a/test/ci_workflow_gen.go b/test/ci_workflow_gen.go index fa4246e8d2e..fbff13ddeb7 100644 --- a/test/ci_workflow_gen.go +++ b/test/ci_workflow_gen.go @@ -172,6 +172,7 @@ type clusterTest struct { EnableBinlogTransactionCompression bool PartialKeyspace bool Cores16 bool + AllowFKNonStandardKey bool } type vitessTesterTest struct { @@ -290,6 +291,9 @@ func generateClusterWorkflows(list []string, tpl string) { if strings.HasPrefix(cluster, "vreplication") || strings.HasSuffix(cluster, "heavy") { test.LimitResourceUsage = true } + if strings.Contains(cluster, "foreignkey") { + test.AllowFKNonStandardKey = true + } if strings.Contains(cluster, "vrepl") { test.EnableBinlogTransactionCompression = true } diff --git a/test/templates/cluster_endtoend_test.tpl b/test/templates/cluster_endtoend_test.tpl index 263114c027e..0e6e6a9fee1 100644 --- a/test/templates/cluster_endtoend_test.tpl +++ b/test/templates/cluster_endtoend_test.tpl @@ -200,6 +200,12 @@ jobs: EOF {{end}} + {{if .AllowFKNonStandardKey }} + cat <<-EOF>>./config/mycnf/mysql84.cnf + restrict_fk_on_non_standard_key=OFF + EOF + {{end}} + {{if .EnableBinlogTransactionCompression}} cat <<-EOF>>./config/mycnf/mysql84.cnf binlog-transaction-compression=ON