mirror of
https://github.com/diesel-rs/diesel.git
synced 2024-10-04 01:28:13 +03:00
Fix a flaky test
This commit is contained in:
parent
325ffc5412
commit
33ff9ee606
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
@ -73,9 +73,9 @@ jobs:
|
||||
run: |
|
||||
sudo systemctl start mysql.service
|
||||
mysql -e "create database diesel_test; create database diesel_unit_test; grant all on \`diesel_%\`.* to 'root'@'localhost';" -uroot -proot
|
||||
echo "MYSQL_DATABASE_URL=mysql://root:root@localhost/diesel_test" >> $GITHUB_ENV
|
||||
echo "MYSQL_EXAMPLE_DATABASE_URL=mysql://root:root@localhost/diesel_example" >> $GITHUB_ENV
|
||||
echo "MYSQL_UNIT_TEST_DATABASE_URL=mysql://root:root@localhost/diesel_unit_test" >> $GITHUB_ENV
|
||||
echo "MYSQL_DATABASE_URL=mysql://root:root@127.0.0.1/diesel_test" >> $GITHUB_ENV
|
||||
echo "MYSQL_EXAMPLE_DATABASE_URL=mysql://root:root@127.0.0.1/diesel_example" >> $GITHUB_ENV
|
||||
echo "MYSQL_UNIT_TEST_DATABASE_URL=mysql://root:root@127.0.0.1/diesel_unit_test" >> $GITHUB_ENV
|
||||
|
||||
- name: Install postgres (MacOS)
|
||||
if: matrix.os == 'macos-13' && matrix.backend == 'postgres'
|
||||
@ -227,7 +227,8 @@ jobs:
|
||||
|
||||
- name: Run tests
|
||||
shell: bash
|
||||
run: cargo xtask run-tests ${{ matrix.backend }} $NO_DOC_TESTS $EXAMPLE_SCHEMA_CHECKS -- --no-fail-fast $FLAGS
|
||||
run: |
|
||||
cargo xtask run-tests ${{ matrix.backend }} $NO_DOC_TESTS $EXAMPLE_SCHEMA_CHECKS -- --no-fail-fast $FLAGS
|
||||
|
||||
- name: Run diesel_benches
|
||||
if: runner.os == 'Linux'
|
||||
|
@ -461,6 +461,7 @@ mod tests {
|
||||
use std::sync::mpsc;
|
||||
use std::sync::Arc;
|
||||
use std::thread;
|
||||
use std::time::Duration;
|
||||
|
||||
use crate::r2d2::*;
|
||||
use crate::test_helpers::*;
|
||||
@ -636,6 +637,9 @@ mod tests {
|
||||
assert_eq!(release_count.load(Ordering::Relaxed), 2);
|
||||
assert_eq!(checkin_count.load(Ordering::Relaxed), 3);
|
||||
assert_eq!(checkout_count.load(Ordering::Relaxed), 3);
|
||||
// this is required to workaround a segfault while shutting down
|
||||
// the pool
|
||||
std::thread::sleep(Duration::from_millis(100));
|
||||
}
|
||||
|
||||
#[cfg(feature = "postgres")]
|
||||
|
Loading…
Reference in New Issue
Block a user