Skip to content

Commit

Permalink
Tests another allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
sanpii committed Oct 9, 2023
1 parent 5bf6744 commit 323787d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,25 @@ jobs:
run: cargo test --no-run --features v14
- name: valgrind
run: valgrind --leak-check=full --error-exitcode=1 $(find target/debug/deps -executable -type f -name 'libpq-*')

jemallocator:
name: Allocation check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable

- name: Install postgreSQL (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libpq-dev postgresql valgrind
sudo service postgresql start && sleep 3
sudo -u postgres psql --command "ALTER USER postgres PASSWORD 'root';"
- name: Adds jemallocator
run: |
cargo add tikv-jemallocator
echo '#[global_allocator] static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;' > src/lib.rs
- name: Run test
run: cargo test --features v14
10 changes: 9 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,16 @@ test:
valgrind:
<<: *pg
variables:
MODE: debug
PG: "14"
script:
- cargo test --no-run --features "v$PG"
- valgrind --leak-check=full --error-exitcode=1 $(find target/debug/deps -executable -type f -name 'libpq-*')

jemallocator:
<<: *pg
variables:
PG: "14"
script:
- cargo add tikv-jemallocator
- echo '#[global_allocator] static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;' > src/lib.rs
- cargo test --features "v$PG"

0 comments on commit 323787d

Please sign in to comment.