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

Sometimes spec failed for illegal time period. #387

Open
janckerchen opened this issue Oct 21, 2017 · 3 comments
Open

Sometimes spec failed for illegal time period. #387

janckerchen opened this issue Oct 21, 2017 · 3 comments

Comments

@janckerchen
Copy link

janckerchen commented Oct 21, 2017

it seems something wrong with mix timeformat, but not always.

"2015-12-09 04:00:00 UTC" and "2015-12-09 12:00:00 +0800"

  2) Jiji::Model::Trading::BackTestRepository テストが3つ登録されている場合 テストで利用しているエージェントが削除されていた場合も、正しく起動できる
     Failure/Error: @repository.load

     ArgumentError:
       illegal period. start_time=2015-12-09 04:00:00 UTC end_time=2015-12-09 12:00:00 +0800
     # /opt/dev/+github/unageanu/jiji2/src/jiji/errors/errors.rb:99:in `illegal_argument'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/securities/internal/virtual/rate_retriever.rb:66:in `check_period'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/securities/internal/virtual/rate_retriever.rb:12:in `init_rate_retriever_state'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/securities/virtual_securities.rb:26:in `initialize'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/brokers/back_test_broker.rb:55:in `new'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/brokers/back_test_broker.rb:55:in `build_components'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/brokers/back_test_broker.rb:25:in `initialize'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/back_test.rb:218:in `new'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/back_test.rb:218:in `create_broker'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/back_test.rb:205:in `create_components'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/back_test.rb:133:in `setup'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/back_test_repository.rb:122:in `setup_backtest'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/back_test_repository.rb:93:in `block in load'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/back_test_repository.rb:92:in `each_with_object'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/back_test_repository.rb:92:in `load'
     # /opt/dev/+github/unageanu/jiji2/spec/jiji/model/trading/back_test_repository_spec.rb:509:in `block (3 levels) in <top (required)>'

@unageanu
Copy link
Owner

It seems that the result has changed depending on the processing status of the backtest running in another thread.I intended to fix them all, but it seems to be still there...

@janckerchen
Copy link
Author

janckerchen commented Oct 22, 2017

yes, another failed is about backtest status.

 Failures:

  1) Jiji::Model::Trading::BackTestRepository テストが3つ登録されている場合 追加したテストは永続化され、再起動時に読み込まれる
     Failure/Error: expect(status[:status]).to eq :running

       expected: :running
            got: :wait_for_finish

       (compared using ==)

       Diff:
       @@ -1,2 +1,2 @@
       -:running
       +:wait_for_finish

     # /opt/dev/+github/unageanu/jiji2/spec/jiji/model/trading/back_test_repository_spec.rb:254:in `block (3 levels) in <top (required)>'

  2) Jiji::Model::Trading::BackTestRepository テストが3つ登録されている場合 テストで利用しているエージェントが削除されていた場合も、正しく起動できる
     Failure/Error: @repository.load

     ArgumentError:
       illegal period. start_time=2015-12-09 04:00:00 UTC end_time=2015-12-09 12:00:00 +0800
     # /opt/dev/+github/unageanu/jiji2/src/jiji/errors/errors.rb:99:in `illegal_argument'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/securities/internal/virtual/rate_retriever.rb:66:in `check_period'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/securities/internal/virtual/rate_retriever.rb:12:in `init_rate_retriever_state'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/securities/virtual_securities.rb:26:in `initialize'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/brokers/back_test_broker.rb:55:in `new'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/brokers/back_test_broker.rb:55:in `build_components'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/brokers/back_test_broker.rb:25:in `initialize'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/back_test.rb:218:in `new'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/back_test.rb:218:in `create_broker'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/back_test.rb:205:in `create_components'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/back_test.rb:133:in `setup'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/back_test_repository.rb:122:in `setup_backtest'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/back_test_repository.rb:93:in `block in load'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/back_test_repository.rb:92:in `each_with_object'
     # /opt/dev/+github/unageanu/jiji2/src/jiji/model/trading/back_test_repository.rb:92:in `load'
     # /opt/dev/+github/unageanu/jiji2/spec/jiji/model/trading/back_test_repository_spec.rb:509:in `block (3 levels) in <top (required)>'

  3) Jiji::Model::Trading::BackTestRepository テストが3つ登録されている場合 #delete テストを削除できる
     Failure/Error: expect(graphs.length).to be 0

       expected #<Fixnum:1> => 0
            got #<Fixnum:3> => 1

       Compared using equal?, which compares object identity,
       but expected and actual are not the same object. Use
       `expect(actual).to eq(expected)` if you don't care about
       object identity in this example.
     # /opt/dev/+github/unageanu/jiji2/spec/jiji/model/trading/back_test_repository_spec.rb:570:in `block (4 levels) in <top (required)>'

@unageanu
Copy link
Owner

Thanks for reporting. It seems like the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants