Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add e2e tests for read-only transaction in multiple sessions #10902

Merged
merged 6 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ description = "Kill cluster, dump logs and check logs"

[tasks.slt]
category = "RiseDev - SQLLogicTest"
install_crate = { version = "0.14.0", crate_name = "sqllogictest-bin", binary = "sqllogictest", test_arg = [
install_crate = { version = "0.15.0", crate_name = "sqllogictest-bin", binary = "sqllogictest", test_arg = [
"--help",
] }
command = "sqllogictest"
Expand Down
2 changes: 1 addition & 1 deletion ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
RUN cargo binstall -y --no-symlinks cargo-llvm-cov cargo-nextest cargo-udeps cargo-hakari cargo-sort cargo-make@0.36.10 cargo-cache cargo-audit \
&& cargo install sccache --locked \
&& cargo install sqllogictest-bin@0.14.0 \
&& cargo install sqllogictest-bin@0.15.0 \
&& cargo cache -a \
&& rm -rf "/root/.cargo/registry/index" \
&& rm -rf "/root/.cargo/registry/cache" \
Expand Down
2 changes: 1 addition & 1 deletion ci/build-ci-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cat ../rust-toolchain
# !!! CHANGE THIS WHEN YOU WANT TO BUMP CI IMAGE !!! #
# AND ALSO docker-compose.yml #
######################################################
export BUILD_ENV_VERSION=v20230702
export BUILD_ENV_VERSION=v20230712

export BUILD_TAG="public.ecr.aws/x5u3w5h6/rw-build-env:${BUILD_ENV_VERSION}"

Expand Down
10 changes: 5 additions & 5 deletions ci/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ services:
retries: 5

source-test-env:
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230702
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230712
depends_on:
- mysql
- db
Expand All @@ -79,7 +79,7 @@ services:
- ..:/risingwave

sink-test-env:
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230702
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230712
depends_on:
- mysql
- db
Expand All @@ -88,12 +88,12 @@ services:
- ..:/risingwave

rw-build-env:
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230702
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230712
volumes:
- ..:/risingwave

ci-flamegraph-env:
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230702
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230712
# NOTE(kwannoel): This is used in order to permit
# syscalls for `nperf` (perf_event_open),
# so it can do CPU profiling.
Expand All @@ -104,7 +104,7 @@ services:
- ..:/risingwave

regress-test-env:
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230702
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230712
depends_on:
db:
condition: service_healthy
Expand Down
64 changes: 64 additions & 0 deletions e2e_test/batch/transaction/read_only_multi_conn.slt
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
statement ok
create table t (v int);

statement ok
insert into t values (1), (2);

statement ok
flush;

statement ok
start transaction read only;

query I
select count(*) from t;
----
2

connection other
query I
select count(*) from t;
----
2

connection other
statement ok
insert into t values (3);

connection other
statement ok
flush;

# inserts are visible in the `other` connection,
connection other
query I
select count(*) from t;
----
3

# ...but not in the read-only transaction
query I
select count(*) from t;
----
2

statement ok
flush;

# still invisible even after flush
query I
select count(*) from t;
----
2

statement ok
commit;

# now visible outside the transaction
query I
select count(*) from t;
----
3

statement ok
drop table t;
1 change: 1 addition & 0 deletions src/tests/simulation/src/slt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const KILL_IGNORE_FILES: &[&str] = &[
// Drop is not retryable in search path test.
"search_path.slt",
// Transaction statements are not retryable.
"transaction/read_only_multi_conn.slt",
"transaction/read_only.slt",
"transaction/tolerance.slt",
];
Expand Down