Skip to content

Commit

Permalink
readyset-psql: Fix citext tests
Browse files Browse the repository at this point in the history
Adds calls to `eventually!` in the two citext tests to ensure that the
prior `CREATE TABLE` statement is replicated before we attempt to
prepare a statement or perform a migration.

Fixes: REA-3062
Change-Id: Ib3363bab6a5fa664ac264455d120d8c7c912d777
Reviewed-on: https://gerrit.readyset.name/c/readyset/+/6223
Tested-by: Buildkite CI
Reviewed-by: Luke Osborne <luke@readyset.io>
Reviewed-by: Aspen Smith <aspen@readyset.io>
  • Loading branch information
ethan-readyset committed Oct 17, 2023
1 parent 6f35839 commit d34ba16
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions readyset-psql/tests/types.rs
Expand Up @@ -893,6 +893,16 @@ mod types {
.await
.unwrap();

// Wait until the `CREATE TABLE` has been replicated
eventually!(run_test: {
let result = client
.simple_query("CREATE CACHE FROM SELECT * FROM t WHERE x = $1")
.await;
AssertUnwindSafe(move || result)
}, then_assert: |result| {
result().unwrap()
});

let stmt = client
.prepare("SELECT * FROM t WHERE x = $1")
.await
Expand Down Expand Up @@ -933,6 +943,16 @@ mod types {
.await
.unwrap();

// Wait until the `CREATE TABLE` has been replicated
eventually!(run_test: {
let result = client
.simple_query("CREATE CACHE FROM SELECT * FROM t WHERE x = $1")
.await;
AssertUnwindSafe(move || result)
}, then_assert: |result| {
result().unwrap()
});

let stmt = client
.prepare("SELECT * FROM t WHERE x = $1")
.await
Expand Down

0 comments on commit d34ba16

Please sign in to comment.