03-toxiproxy-interrupt.td 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. > SELECT COUNT(*) = 0 FROM mz_internal.mz_source_statuses WHERE error LIKE '%connection closed%';
  10. true
  11. # This REST call will cause toxiproxy to close the connection.
  12. $ http-request method=POST url=http://toxiproxy:8474/proxies/postgres content-type=application/json
  13. {
  14. "name": "postgres",
  15. "listen": "0.0.0.0:5432",
  16. "upstream": "postgres:5432",
  17. "enabled": false
  18. }
  19. > SELECT COUNT(*) > 0 FROM mz_internal.mz_source_statuses WHERE error LIKE '%connection closed%';
  20. true
  21. # Ensure we don't lose ceased status even if source is stalled
  22. > SELECT name, status FROM mz_internal.mz_source_statuses;
  23. pg_source stalled
  24. pg_source_progress running
  25. t ceased
  26. $ http-request method=POST url=http://toxiproxy:8474/proxies/postgres content-type=application/json
  27. {
  28. "name": "postgres",
  29. "listen": "0.0.0.0:5432",
  30. "upstream": "postgres:5432",
  31. "enabled": true
  32. }