MrRobb / gym-rs

OpenAI Gym bindings for Rust
MIT License
61 stars 4 forks source link

cargo test fails #8

Closed worikgh closed 4 years ago

worikgh commented 4 years ago

On a new install fresh from githup. Tests 3,4, and 5 fail

Need to run: pip3 install gym[atari]

Then test 4 only fails

---- tests::test_4_reset stdout ----
Response { url: "http://127.0.0.1:8003/v1/envs/d027c24a/reset/", status: 200, headers: {"content-type": "application/json", "content-length": "368264", "server": "Werkzeug/0.16.0 Python/3.7.3", "date": "Sat, 12 Oct 2019 00:32:05 GMT"} }
thread 'tests::test_4_reset' panicked at 'assertion failed: env.reset().is_ok()', src/lib.rs:353:4
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

failures:
    tests::test_4_reset
MrRobb commented 4 years ago

I have added new requirements (13ed73018e0147f9140aad9dde2dd8ab699a196e). Could you install them and try again cargo test, please? . It seems to work for me. Thank you!

running 5 tests
 * Serving Flask app "server" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
test tests::test_1_new ... ok
test tests::test_2_new_quiet ... ok
test tests::test_3_make ... ok
test tests::test_4_reset ... ok
test tests::test_5_step ... ok

test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
worikgh commented 4 years ago

The main issue I have encountered is ensuring that the rust client can find server.py I have it going from my own client (using the Git version of gym-rs) by making a link from the root directory of my client to server.py.

worikgh commented 4 years ago

I am having intermittent failures now. It looks to me like that python server is a bit flaky, which would not surprise me.

running 5 tests
test tests::test_1_new ... ok
test tests::test_3_make ... FAILED
test tests::test_2_new_quiet ... ok
test tests::test_4_reset ... FAILED
test tests::test_5_step ... FAILED

failures:

---- tests::test_3_make stdout ----
thread 'tests::test_3_make' panicked at 'Unable to create the environment: http://127.0.0.1:8002/v1/envs/: error trying to connect: Connection refused (os error 111)', src/lib.rs:339:26
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

---- tests::test_4_reset stdout ----
Response { url: "http://127.0.0.1:8003/v1/envs/4c270146/reset/", status: 200, headers: {"content-type": "application/json", "content-length": "368264", "server": "Werkzeug/0.16.0 Python/3.7.3", "date": "Fri, 18 Oct 2019 01:49:20 GMT"} }
thread 'tests::test_4_reset' panicked at 'assertion failed: env.reset().is_ok()', src/lib.rs:352:4

---- tests::test_5_step stdout ----
KellyCoinflipGeneralized-v0 -> [939634.0]
KellyCoinflip-v0 -> [5207.0]
Blackjack-v0 -> [0.0]
LunarLanderContinuous-v2 -> [0.20918219241045666, -0.7090193375323848]
Copy-v0 -> [1.0, 0.0, 0.0]
Bowling-ram-v0 -> [5.0]
Response { url: "http://127.0.0.1:8004/v1/envs/642ed2b4/reset/", status: 200, headers: {"content-type": "application/json", "content-length": "368264", "server": "Werkzeug/0.16.0 Python/3.7.3", "date": "Fri, 18 Oct 2019 01:49:21 GMT"} }
thread 'tests::test_5_step' panicked at 'called `Result::unwrap()` on an `Err` value: Connection(Error(Hyper(Error(Body, Os { code: 104, kind: ConnectionReset, message: "Connection reset by peer" }))))', src/libcore/result.rs:1084:5
worikgh commented 4 years ago

Repeating the above test 3 passed.

Knowing very little python, is there anything I can do to diagnose this for you?

worikgh commented 4 years ago

Removing VideoPinball-v0 from the ENVS global fixes the tests, it seems. I have no explanation for why.