Electron100 / butane

An ORM for Rust with a focus on simplicity and on writing Rust, not SQL
Apache License 2.0
91 stars 13 forks source link

Occasionally seeing problems loading migrations in the pg test harness #56

Closed jayvdb closed 5 months ago

jayvdb commented 1 year ago

line 22 below is

butane::migrations::copy_migration(disk_current, mem_current).unwrap();

Intermittent failure:

running 4 tests
test roundtrip_custom_type_sqlite ... ok
test query_custom_type_sqlite ... ok
test roundtrip_custom_type_pg ... FAILED
test query_custom_type_pg ... FAILED

failures:

---- roundtrip_custom_type_pg stdout ----
pg_setup
new db is `butane_test_3d96e5e553b44700b28665caa1d1a7f7`
connecting to host=/home/jayvdb/rust/butane/butane/tmp_pg/1003e580-d533-47fe-9094-07c1005fa8db/socket user=postgres dbname=butane_test_3d96e5e553b44700b28665caa1d1a7f7
thread 'roundtrip_custom_type_pg' panicked at 'called `Result::unwrap()` on an `Err` value: IO(Os { code: 2, kind: NotFound, message: "No such file or directory" })', butane/tests/common/mod.rs:22:67
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- query_custom_type_pg stdout ----
pg_setup
create tmp server
created tmp server!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
new db is `butane_test_53addeb0068949dda891c3005397c3f1`
connecting to host=/home/jayvdb/rust/butane/butane/tmp_pg/1003e580-d533-47fe-9094-07c1005fa8db/socket user=postgres dbname=butane_test_53addeb0068949dda891c3005397c3f1
thread 'query_custom_type_pg' panicked at 'called `Result::unwrap()` on an `Err` value: IO(Os { code: 2, kind: NotFound, message: "No such file or directory" })', butane/tests/common/mod.rs:22:67

Also occurred earlier today for Running tests/basic.rs ..., same error, only pg.

Note to self, it occurred when modifying butane_core/src/*.rs

Electron100 commented 1 year ago

I suspect that if we go forward with #60 this will be solved as a side-effect since the time of file IO to the migration structures on disk will be more tightly controlled.

jayvdb commented 1 year ago

I havent seen this in quite a while, and was wondering if it had fixed itself, but just saw it now in r2d2_pq test.

jayvdb commented 5 months ago

I tried to reproduce this by repeatedly running tests in butane/ to no avail.

Then repeating tests in / (all projects), it quickly appeared, but still takes many repeats.

I added a bunch of .unwrap() and it fails in self.lock_shared() here:

impl Migration for FsMigration {
    fn db(&self) -> Result<ADB> {
        let _lock = self.lock_shared().unwrap();
        let mut db = ADB::new();
        self.ensure_dir().unwrap();

fail log

[2024-03-18T06:19:26Z INFO  json] connecting to host=/tmp/.tmpGK4Lwh user=postgres dbname=butane_test_efe43fa4a2074ae599a4ccf105d782f9..
[2024-03-18T06:19:26Z INFO  json] connecting to host=/tmp/.tmpGK4Lwh user=postgres dbname=butane_test_f165cf5c4524411d832db18c2a9766f4..
[2024-03-18T06:19:26Z INFO  butane_test_helper] Loading migrations from FsMigration { fs: OsFilesystem, root: "/home/jayvdb/rust/butane/butane/.butane/migrations/current" }
[2024-03-18T06:19:26Z INFO  json] connecting to host=/tmp/.tmpGK4Lwh user=postgres dbname=butane_test_6a4f10394fd94fab9baf844219bd78a9..
[2024-03-18T06:19:26Z INFO  json] connecting to host=/tmp/.tmpGK4Lwh user=postgres dbname=butane_test_d8724c7e407a4f16b2cbb524d01457db..
[2024-03-18T06:19:26Z INFO  json] connecting to host=/tmp/.tmpGK4Lwh user=postgres dbname=butane_test_e36daeaf5ffd406fa51471bccd986ba8..
[2024-03-18T06:19:26Z INFO  butane_test_helper] Loading migrations from FsMigration { fs: OsFilesystem, root: "/home/jayvdb/rust/butane/butane/.butane/migrations/current" }
[2024-03-18T06:19:26Z INFO  butane_test_helper] Loading migrations from FsMigration { fs: OsFilesystem, root: "/home/jayvdb/rust/butane/butane/.butane/migrations/current" }
[2024-03-18T06:19:26Z INFO  butane_test_helper] Loading migrations from FsMigration { fs: OsFilesystem, root: "/home/jayvdb/rust/butane/butane/.butane/migrations/current" }
[2024-03-18T06:19:26Z INFO  butane_test_helper] Loading migrations from FsMigration { fs: OsFilesystem, root: "/home/jayvdb/rust/butane/butane/.butane/migrations/current" }
[2024-03-18T06:19:26Z INFO  json] connecting to host=/tmp/.tmpGK4Lwh user=postgres dbname=butane_test_3d0c5ca1cd874672af2bc56004aad7f7..
[2024-03-18T06:19:26Z INFO  json] connecting to host=/tmp/.tmpGK4Lwh user=postgres dbname=butane_test_9a1c3baac5c2462586fdd716e9b2036c..
test basic_hashmap_pg ... FAILED
test json_null_pg ... FAILED
test basic_btreemap_pg ... FAILED
test basic_hashmap_full_prefix_pg ... FAILED
test basic_json_pg ... FAILED
[2024-03-18T06:19:26Z INFO  butane_test_helper] Loading migrations from FsMigration { fs: OsFilesystem, root: "/home/jayvdb/rust/butane/butane/.butane/migrations/current" }
test hashmap_with_object_values_pg ... FAILED
[2024-03-18T06:19:26Z INFO  butane_test_helper] Loading migrations from FsMigration { fs: OsFilesystem, root: "/home/jayvdb/rust/butane/butane/.butane/migrations/current" }
test inline_json_pg ... FAILED

failures:

---- basic_hashmap_pg stdout ----
thread 'basic_hashmap_pg' panicked at butane_core/src/migrations/fsmigrations.rs:208:40:
called `Result::unwrap()` on an `Err` value: IO(Os { code: 2, kind: NotFound, message: "No such file or directory" })
stack backtrace:
   0: rust_begin_unwind
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1649:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1073:23
   4: <butane_core::migrations::fsmigrations::FsMigration as butane_core::migrations::migration::Migration>::db
             at /home/jayvdb/rust/butane/butane_core/src/migrations/fsmigrations.rs:208:21
   5: butane_test_helper::setup_db
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:194:14
   6: json::basic_hashmap_pg
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:239:17
   7: json::basic_hashmap_pg::{{closure}}
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:233:43
   8: core::ops::function::FnOnce::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
   9: core::ops::function::FnOnce::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- json_null_pg stdout ----
thread 'json_null_pg' panicked at butane_core/src/migrations/fsmigrations.rs:208:40:
called `Result::unwrap()` on an `Err` value: IO(Os { code: 2, kind: NotFound, message: "No such file or directory" })
stack backtrace:
   0: rust_begin_unwind
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1649:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1073:23
   4: <butane_core::migrations::fsmigrations::FsMigration as butane_core::migrations::migration::Migration>::db
             at /home/jayvdb/rust/butane/butane_core/src/migrations/fsmigrations.rs:208:21
   5: butane_test_helper::setup_db
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:194:14
   6: json::json_null_pg
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:239:17
   7: json::json_null_pg::{{closure}}
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:233:43
   8: core::ops::function::FnOnce::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
   9: core::ops::function::FnOnce::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- basic_btreemap_pg stdout ----
thread 'basic_btreemap_pg' panicked at butane_core/src/migrations/fsmigrations.rs:208:40:
called `Result::unwrap()` on an `Err` value: IO(Os { code: 2, kind: NotFound, message: "No such file or directory" })
stack backtrace:
   0: rust_begin_unwind
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1649:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1073:23
   4: <butane_core::migrations::fsmigrations::FsMigration as butane_core::migrations::migration::Migration>::db
             at /home/jayvdb/rust/butane/butane_core/src/migrations/fsmigrations.rs:208:21
   5: butane_test_helper::setup_db
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:194:14
   6: json::basic_btreemap_pg
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:239:17
   7: json::basic_btreemap_pg::{{closure}}
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:233:43
   8: core::ops::function::FnOnce::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
   9: core::ops::function::FnOnce::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- basic_hashmap_full_prefix_pg stdout ----
thread 'basic_hashmap_full_prefix_pg' panicked at butane_core/src/migrations/fsmigrations.rs:208:40:
called `Result::unwrap()` on an `Err` value: IO(Os { code: 2, kind: NotFound, message: "No such file or directory" })
stack backtrace:
   0: rust_begin_unwind
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1649:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1073:23
   4: <butane_core::migrations::fsmigrations::FsMigration as butane_core::migrations::migration::Migration>::db
             at /home/jayvdb/rust/butane/butane_core/src/migrations/fsmigrations.rs:208:21
   5: butane_test_helper::setup_db
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:194:14
   6: json::basic_hashmap_full_prefix_pg
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:239:17
   7: json::basic_hashmap_full_prefix_pg::{{closure}}
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:233:43
   8: core::ops::function::FnOnce::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
   9: core::ops::function::FnOnce::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- basic_json_pg stdout ----
thread 'basic_json_pg' panicked at butane_core/src/migrations/fsmigrations.rs:208:40:
called `Result::unwrap()` on an `Err` value: IO(Os { code: 2, kind: NotFound, message: "No such file or directory" })
stack backtrace:
   0: rust_begin_unwind
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1649:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1073:23
   4: <butane_core::migrations::fsmigrations::FsMigration as butane_core::migrations::migration::Migration>::db
             at /home/jayvdb/rust/butane/butane_core/src/migrations/fsmigrations.rs:208:21
   5: butane_test_helper::setup_db
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:194:14
   6: json::basic_json_pg
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:239:17
   7: json::basic_json_pg::{{closure}}
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:233:43
   8: core::ops::function::FnOnce::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
   9: core::ops::function::FnOnce::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- hashmap_with_object_values_pg stdout ----
thread 'hashmap_with_object_values_pg' panicked at butane_core/src/migrations/fsmigrations.rs:208:40:
called `Result::unwrap()` on an `Err` value: IO(Os { code: 2, kind: NotFound, message: "No such file or directory" })
stack backtrace:
   0: rust_begin_unwind
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1649:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1073:23
   4: <butane_core::migrations::fsmigrations::FsMigration as butane_core::migrations::migration::Migration>::db
             at /home/jayvdb/rust/butane/butane_core/src/migrations/fsmigrations.rs:208:21
   5: butane_test_helper::setup_db
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:194:14
   6: json::hashmap_with_object_values_pg
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:239:17
   7: json::hashmap_with_object_values_pg::{{closure}}
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:233:43
   8: core::ops::function::FnOnce::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
   9: core::ops::function::FnOnce::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- inline_json_pg stdout ----
thread 'inline_json_pg' panicked at butane_core/src/migrations/fsmigrations.rs:208:40:
called `Result::unwrap()` on an `Err` value: IO(Os { code: 2, kind: NotFound, message: "No such file or directory" })
stack backtrace:
   0: rust_begin_unwind
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1649:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1073:23
   4: <butane_core::migrations::fsmigrations::FsMigration as butane_core::migrations::migration::Migration>::db
             at /home/jayvdb/rust/butane/butane_core/src/migrations/fsmigrations.rs:208:21
   5: butane_test_helper::setup_db
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:194:14
   6: json::inline_json_pg
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:239:17
   7: json::inline_json_pg::{{closure}}
             at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:233:43
   8: core::ops::function::FnOnce::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
   9: core::ops::function::FnOnce::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

failures:
    basic_btreemap_pg
    basic_hashmap_full_prefix_pg
    basic_hashmap_pg
    basic_json_pg
    hashmap_with_object_values_pg
    inline_json_pg
    json_null_pg

test result: FAILED. 7 passed; 7 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.29s
jayvdb commented 5 months ago

With https://github.com/Electron100/butane/pull/213 (first commit; "Create dir before lock"), the problem now occurs a bit later in the pg helper

---- hashmap_with_object_values_pg stdout ----
thread 'hashmap_with_object_values_pg' panicked at butane_test_helper/src/lib.rs:196:5:
expected to create migration
stack backtrace:
   0:     0x55bea5fd5466 - std::backtrace_rs::backtrace::libunwind::trace::hbee8a7973eeb6c93
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x55bea5fd5466 - std::backtrace_rs::backtrace::trace_unsynchronized::hc8ac75eea3aa6899
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55bea5fd5466 - std::sys_common::backtrace::_print_fmt::hc7f3e3b5298b1083
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x55bea5fd5466 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hbb235daedd7c6190
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x55bea6003120 - core::fmt::rt::Argument::fmt::h76c38a80d925a410
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/rt.rs:142:9
   5:     0x55bea6003120 - core::fmt::write::h3ed6aeaa977c8e45
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/mod.rs:1120:17
   6:     0x55bea5fd21ef - std::io::Write::write_fmt::h1299aa7741865f2b
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/io/mod.rs:1810:15
   7:     0x55bea5fd5244 - std::sys_common::backtrace::_print::h5d645a07e0fcfdbb
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x55bea5fd5244 - std::sys_common::backtrace::print::h85035a511aafe7a8
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x55bea5fd6fb7 - std::panicking::default_hook::{{closure}}::hcce8cea212785a25
  10:     0x55bea5fd6c9d - std::panicking::default_hook::hf5fcb0f213fe709a
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:289:9
  11:     0x55bea57d87b7 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h60265c2dfa87ee34
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2029:9
  12:     0x55bea57d87b7 - test::test_main::{{closure}}::h77865bd3127078c6
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/test/src/lib.rs:138:21
  13:     0x55bea5fd75d6 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hbc5ccf4eb663e1e5
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2029:9
  14:     0x55bea5fd75d6 - std::panicking::rust_panic_with_hook::h095fccf1dc9379ee
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:783:13
  15:     0x55bea5fd72e9 - std::panicking::begin_panic_handler::{{closure}}::h032ba12139b353db
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:649:13
  16:     0x55bea5fd5966 - std::sys_common::backtrace::__rust_end_short_backtrace::h9259bc2ff8fd0f76
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:171:18
  17:     0x55bea5fd7080 - rust_begin_unwind
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
  18:     0x55bea573dc15 - core::panicking::panic_fmt::h784f20a50eaab275
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
  19:     0x55bea57e4937 - butane_test_helper::setup_db::hd378b75a11f5653a
                               at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:196:5
  20:     0x55bea575a0a9 - json::hashmap_with_object_values_pg::hd58e92e355aa08f9
                               at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:238:17
  21:     0x55bea5750167 - json::hashmap_with_object_values_pg::{{closure}}::hfae3e991902002dc
                               at /home/jayvdb/rust/butane/butane_test_helper/src/lib.rs:232:43
  22:     0x55bea5772176 - core::ops::function::FnOnce::call_once::ha498c56b4e4af26d
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
  23:     0x55bea57de08f - core::ops::function::FnOnce::call_once::h8dc6907944022cf6
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
  24:     0x55bea57de08f - test::__rust_begin_short_backtrace::haae1a87433f1efb3
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/test/src/lib.rs:627:18
  25:     0x55bea57dce11 - test::run_test_in_process::{{closure}}::h8c7decfa7c14e152
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/test/src/lib.rs:650:60
  26:     0x55bea57dce11 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h19e6ff056d9d21e9
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panic/unwind_safe.rs:272:9
  27:     0x55bea57dce11 - std::panicking::try::do_call::h89c848fcaa37c035
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
  28:     0x55bea57dce11 - std::panicking::try::h57ab3dc74e2839b8
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
  29:     0x55bea57dce11 - std::panic::catch_unwind::hfb6a1b1abc120fb9
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
  30:     0x55bea57dce11 - test::run_test_in_process::h5ae2f9875edd562d
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/test/src/lib.rs:650:27
  31:     0x55bea57dce11 - test::run_test::{{closure}}::h35d7300d8928a067
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/test/src/lib.rs:573:43
  32:     0x55bea57a4146 - test::run_test::{{closure}}::h7525ced405d23d1b
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/test/src/lib.rs:601:41
  33:     0x55bea57a4146 - std::sys_common::backtrace::__rust_begin_short_backtrace::h4e7db78ce05afad8
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:155:18
  34:     0x55bea57a91a7 - std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}::hcfbcb64f1a1b3482
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/thread/mod.rs:529:17
  35:     0x55bea57a91a7 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h9d89c5c4108bd689
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panic/unwind_safe.rs:272:9
  36:     0x55bea57a91a7 - std::panicking::try::do_call::h8a4869bc94ec50c9
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
  37:     0x55bea57a91a7 - std::panicking::try::h9a576f20ff81ac30
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
  38:     0x55bea57a91a7 - std::panic::catch_unwind::hbcb4e3f860ef9830
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
  39:     0x55bea57a91a7 - std::thread::Builder::spawn_unchecked_::{{closure}}::h93c79a6be1505948
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/thread/mod.rs:528:30
  40:     0x55bea57a91a7 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h426d96740c81bdaf
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
  41:     0x55bea5fdcff5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h12de4fc57affb195
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2015:9
  42:     0x55bea5fdcff5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3c619f45059d5cf1
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2015:9
  43:     0x55bea5fdcff5 - std::sys::unix::thread::Thread::new::thread_start::hbac657605e4b7389
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys/unix/thread.rs:108:17
  44:     0x7feed7a92bb2 - start_thread
  45:     0x7feed7b1400c - clone3
  46:                0x0 - <unknown>
jayvdb commented 5 months ago

I can reliably trigger this by running the tests repeatedly in the console without rust-analyzer running, and then opening VS code with rust-analyzer doing its thing on startup.

This would explain why it never occurs in CI.

jayvdb commented 5 months ago

so im pretty confident it is https://github.com/Electron100/butane/blob/master/butane/build.rs doing the deleting. curious it is never sqlite tests which fail.

jayvdb commented 5 months ago

A quite easy way to reduce this to negligible effect is to update build.rs to find the latest updated timestamp of files in butane/tests , and only delete files in butane/.butane/ if they are older than that. I'll look into that.