<commit_before>#!/usr/bin/env bats

load helpers

@test "gateway-primary proxy admin is up on :19000" {
  retry_default curl -f -s localhost:19000/stats -o /dev/null
}

@test "gateway-primary should have healthy endpoints for secondary" {
  assert_upstream_has_endpoints_in_status 127.0.0.1:19000 secondary HEALTHY 1
}

@test "gateway-primary should have healthy endpoints for secondary servers" {
  assert_upstream_has_endpoints_in_status 127.0.0.1:19000 server.secondary.consul HEALTHY 1
}

@test "gateway-primary should have healthy endpoints for lone primary server" {
  assert_upstream_has_endpoints_in_status 127.0.0.1:19000 pri.server.primary.consul HEALTHY 1
}

@test "gateway-secondary should be up and listening" {
  retry_long nc -z consul-secondary:4432
}

@test "primary should be able to rpc to the secondary" {
  retry_default curl -sL -f -XPUT localhost:8500/v1/kv/foo?dc=secondary -d'{"Value":"bar"}'
}

@test "wan pool should show 2 healthy nodes" {
  assert_alive_wan_member_count 2
}<commit_msg>Bump retry time for cross-DC RPC<commit_after>#!/usr/bin/env bats

load helpers

@test "gateway-primary proxy admin is up on :19000" {
  retry_default curl -f -s localhost:19000/stats -o /dev/null
}

@test "gateway-primary should have healthy endpoints for secondary" {
  assert_upstream_has_endpoints_in_status 127.0.0.1:19000 secondary HEALTHY 1
}

@test "gateway-primary should have healthy endpoints for secondary servers" {
  assert_upstream_has_endpoints_in_status 127.0.0.1:19000 server.secondary.consul HEALTHY 1
}

@test "gateway-primary should have healthy endpoints for lone primary server" {
  assert_upstream_has_endpoints_in_status 127.0.0.1:19000 pri.server.primary.consul HEALTHY 1
}

@test "gateway-secondary should be up and listening" {
  retry_long nc -z consul-secondary:4432
}

@test "primary should be able to rpc to the secondary" {
  retry_long curl -sL -f -XPUT localhost:8500/v1/kv/foo?dc=secondary -d'{"Value":"bar"}'
}

@test "wan pool should show 2 healthy nodes" {
  assert_alive_wan_member_count 2
}
{'fraction_non_alphanumeric': 0.09335288367546432, 'fraction_numerical': 0.05571847507331378, 'mean_word_length': 4.865329512893982, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5936216', 'n_tokens_mistral': 790, 'n_tokens_neox': 706, 'n_words': 203}