Skip to content

Commit

Permalink
Quick fix for panic logging in tests
Browse files Browse the repository at this point in the history
Fixed panic logging by removing registering panic hook in tests.
Its not so critical now because in this way we only lost backtrace for panic in some cases in tests
Needed more investigation in the future
  • Loading branch information
Michael Watson authored and Michael Watson committed Mar 10, 2022
1 parent dd176d5 commit d271400
Show file tree
Hide file tree
Showing 17 changed files with 187 additions and 187 deletions.
Empty file added 1
Empty file.
14 changes: 7 additions & 7 deletions core/src/balance_changes/profit_loss_stopper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub(crate) mod test {
use std::sync::Arc;

use chrono::Duration;
use mmb_utils::{infrastructure::init_infrastructure, DateTime};
use mmb_utils::{logger::init_logger_file_named, DateTime};
use parking_lot::{Mutex, ReentrantMutexGuard};
use rust_decimal_macros::dec;

Expand Down Expand Up @@ -325,7 +325,7 @@ pub(crate) mod test {

#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
pub async fn add_change_should_calculate_usd_correctly() {
init_infrastructure("log.txt");
init_logger_file_named("log.txt");
let context = init(max_period(), 4);

context
Expand Down Expand Up @@ -359,7 +359,7 @@ pub(crate) mod test {

#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
pub async fn add_change_should_ignore_old_data() {
init_infrastructure("log.txt");
init_logger_file_named("log.txt");
let context = init(max_period(), 3);

context
Expand Down Expand Up @@ -387,7 +387,7 @@ pub(crate) mod test {

#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
pub async fn check_for_limit_should_stop_transaction() {
init_infrastructure("log.txt");
init_logger_file_named("log.txt");
let (mut exchange_blocker, exchange_blocker_locker) = ExchangeBlocker::init_mock();
exchange_blocker
.expect_block()
Expand Down Expand Up @@ -440,7 +440,7 @@ pub(crate) mod test {

#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
pub async fn check_for_limit_should_recover_after_positive_tarde() {
init_infrastructure("log.txt");
init_logger_file_named("log.txt");
let (mut exchange_blocker, exchange_blocker_locker) = ExchangeBlocker::init_mock();
exchange_blocker
.expect_block()
Expand Down Expand Up @@ -517,7 +517,7 @@ pub(crate) mod test {

#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
pub async fn check_for_limit_should_recover_after_first_change_expired() {
init_infrastructure("log.txt");
init_logger_file_named("log.txt");
let (mut exchange_blocker, exchange_blocker_locker) = ExchangeBlocker::init_mock();
exchange_blocker
.expect_block()
Expand Down Expand Up @@ -602,7 +602,7 @@ pub(crate) mod test {

#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
pub async fn check_for_limit_should_recover_after_time_period() {
init_infrastructure("log.txt");
init_logger_file_named("log.txt");
let (mut exchange_blocker, exchange_blocker_locker) = ExchangeBlocker::init_mock();
exchange_blocker
.expect_block()
Expand Down
Loading

0 comments on commit d271400

Please sign in to comment.