From 27ce179575cc978c3635903c73ea6247efea7295 Mon Sep 17 00:00:00 2001 From: Dave Troiano Date: Wed, 27 Jul 2022 16:51:28 -0400 Subject: [PATCH] add a wait before validating ksqlDB recipe tests relying on table output The handful of tests that query table output tend to be flaky due to the async nature of ksqlDB. There's no guarantee that table results are available after corresponding INSERTS. Other recipes that validate via a stream query like "SELECT ... EMIT CHANGES LIMIT n;" aren't susceptible to the same test flakiness since they will block on n rows being emitted. --- _data/harnesses/logistics/ksql-test.yml | 16 ++++++++++++++++ _data/harnesses/mainframe-offload/ksql-test.yml | 16 ++++++++++++++++ _data/harnesses/model-retraining/ksql-test.yml | 16 ++++++++++++++++ .../harnesses/payment-status-check/ksql-test.yml | 16 ++++++++++++++++ 4 files changed, 64 insertions(+) diff --git a/_data/harnesses/logistics/ksql-test.yml b/_data/harnesses/logistics/ksql-test.yml index 60406d93e2..1c78c17627 100644 --- a/_data/harnesses/logistics/ksql-test.yml +++ b/_data/harnesses/logistics/ksql-test.yml @@ -44,4 +44,20 @@ test: skip: true stdin: - file: ../../confluent/code/tutorial-steps/dev/manual.sql + + - name: wait for table to be populated + action: sleep + ms: 5000 + render: + skip: true + + - action: docker_ksql_cli_session + container: ksqldb-cli + docker_bootup_file: start-cli.sh + stdout: + directory: tutorial-steps/test/outputs + column_width: 75 + render: + skip: true + stdin: - file: tutorial-steps/test/validate.sql diff --git a/_data/harnesses/mainframe-offload/ksql-test.yml b/_data/harnesses/mainframe-offload/ksql-test.yml index 33be2e3e29..8daff8da59 100644 --- a/_data/harnesses/mainframe-offload/ksql-test.yml +++ b/_data/harnesses/mainframe-offload/ksql-test.yml @@ -44,4 +44,20 @@ test: skip: true stdin: - file: ../../confluent/code/tutorial-steps/dev/manual.sql + + - name: wait for table to be populated + action: sleep + ms: 5000 + render: + skip: true + + - action: docker_ksql_cli_session + container: ksqldb-cli + docker_bootup_file: start-cli.sh + stdout: + directory: tutorial-steps/test/outputs + column_width: 75 + render: + skip: true + stdin: - file: tutorial-steps/test/validate.sql diff --git a/_data/harnesses/model-retraining/ksql-test.yml b/_data/harnesses/model-retraining/ksql-test.yml index 60406d93e2..1c78c17627 100644 --- a/_data/harnesses/model-retraining/ksql-test.yml +++ b/_data/harnesses/model-retraining/ksql-test.yml @@ -44,4 +44,20 @@ test: skip: true stdin: - file: ../../confluent/code/tutorial-steps/dev/manual.sql + + - name: wait for table to be populated + action: sleep + ms: 5000 + render: + skip: true + + - action: docker_ksql_cli_session + container: ksqldb-cli + docker_bootup_file: start-cli.sh + stdout: + directory: tutorial-steps/test/outputs + column_width: 75 + render: + skip: true + stdin: - file: tutorial-steps/test/validate.sql diff --git a/_data/harnesses/payment-status-check/ksql-test.yml b/_data/harnesses/payment-status-check/ksql-test.yml index 60406d93e2..1c78c17627 100644 --- a/_data/harnesses/payment-status-check/ksql-test.yml +++ b/_data/harnesses/payment-status-check/ksql-test.yml @@ -44,4 +44,20 @@ test: skip: true stdin: - file: ../../confluent/code/tutorial-steps/dev/manual.sql + + - name: wait for table to be populated + action: sleep + ms: 5000 + render: + skip: true + + - action: docker_ksql_cli_session + container: ksqldb-cli + docker_bootup_file: start-cli.sh + stdout: + directory: tutorial-steps/test/outputs + column_width: 75 + render: + skip: true + stdin: - file: tutorial-steps/test/validate.sql