github-8810.td 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. # Regression test for https://github.com/MaterializeInc/database-issues/issues/8810.
  10. $ set-arg-default single-replica-cluster=quickstart
  11. $ postgres-execute connection=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}
  12. ALTER SYSTEM SET storage_statistics_interval = '1s';
  13. ALTER SYSTEM SET storage_statistics_collection_interval = '1s';
  14. $ kafka-create-topic topic=data
  15. > CREATE CONNECTION kafka_conn
  16. TO KAFKA (BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT);
  17. > CREATE SOURCE src
  18. IN CLUSTER ${arg.single-replica-cluster}
  19. FROM KAFKA CONNECTION kafka_conn (TOPIC 'testdrive-data-${testdrive.seed}')
  20. > SELECT rehydration_latency < '5' FROM mz_internal.mz_source_statistics
  21. JOIN mz_sources USING (id)
  22. WHERE name = 'src'
  23. true
  24. # Wait for some time to ensure a regression would increase the rehydration
  25. # latency to a noticeable amount.
  26. $ sleep-is-probably-flaky-i-have-justified-my-need-with-a-comment duration="5s"
  27. > CREATE TABLE tbl FROM SOURCE src
  28. # Wait for the source statistics to be refreshed. This happens every 1s, so
  29. # waiting for 2s should be safe.
  30. $ sleep-is-probably-flaky-i-have-justified-my-need-with-a-comment duration="2s"
  31. > SELECT rehydration_latency < '5' FROM mz_internal.mz_source_statistics
  32. JOIN mz_sources USING (id)
  33. WHERE name = 'src'
  34. true