neo4j-core icon indicating copy to clipboard operation
neo4j-core copied to clipboard

expired and failed cypher transactions

Open dpisarewski opened this issue 10 years ago • 13 comments

I also changed CypherResponse so that it retrieves all errors from response body.

dpisarewski avatar Jan 05 '15 11:01 dpisarewski

Really nice! This didn't run on Travis for some reason. Could you push something (anything) to your branch to see if it'll submit now?

subvertallchris avatar Jan 05 '15 15:01 subvertallchris

Oh sorry, there are merge conflicts.

dpisarewski avatar Jan 05 '15 15:01 dpisarewski

Ah, right. I'm a little spoiled by pushing directly to branches on this repo, where it will always run at least one set of tests on Travis. :-)

Can you correct your merge conflicts so we can run tests before merge?

subvertallchris avatar Jan 05 '15 15:01 subvertallchris

I added some examples into cypher_transaction_spec.rb. Why is the whole spec commented out? https://github.com/neo4jrb/neo4j-core/blob/master/spec/neo4j-server/unit/cypher_transaction_spec.rb

dpisarewski avatar Jan 05 '15 15:01 dpisarewski

It was meant to be removed, I don't think it's a useful set of tests because of the intense amount of stubbing going on, it's too tied to implementation. I commented it out while working on the efficient_transactions branch and forgot to remove it.

subvertallchris avatar Jan 05 '15 15:01 subvertallchris

Something to watch out for is tx = Neo4j::Transaction.new. Right now, the expectation is that tx would be the only transaction object, so you can do tx.failed? or tx.expired?. If new objects are created as the transaction's state changes, we'll need to delegate to those new objects.

subvertallchris avatar Jan 05 '15 17:01 subvertallchris

When I run specs on master branch I get these errors:

Failures:

  1) Neo4j::Server::CypherTransaction#del deletes a node
     Failure/Error: tx.close
     Neo4j::Server::Resource::ServerException:
       Expected response code 200 Error for request http://localhost:7474/db/data/transaction/5437/commit, 404, 404
     # ./lib/neo4j-server/resource.rb:33:in `handle_response_error'
     # ./lib/neo4j-server/resource.rb:37:in `expect_response_code'
     # ./lib/neo4j-server/cypher_transaction.rb:46:in `_tx_query'
     # ./lib/neo4j-server/cypher_transaction.rb:38:in `_commit_tx'
     # ./lib/neo4j/transaction.rb:65:in `close'
     # ./spec/neo4j-server/e2e/cypher_transaction_spec.rb:185:in `Server'

  2) Cypher Queries CREATE (v1) RETURN ID(v1) returns correct response
     Failure/Error: response = HTTParty.send(:post, cypher_url, headers: resource_headers, body: body)
     NameError:
       uninitialized constant HTTParty
     # ./spec/neo4j-server/rest/create_node_spec.rb:14:in `(root)'

Am I missing something for the test environment?

dpisarewski avatar Jan 06 '15 10:01 dpisarewski

I got those too, so I don't think it's you. Didn't have time to check it out when I looked earlier

cheerfulstoic avatar Jan 06 '15 10:01 cheerfulstoic

Coverage Status

Coverage decreased (-0.06%) when pulling a24194faa28fd5c80ba9ff5b20eda5a815da8222 on dpisarewski:invalid_transactions into aa6934521083c935e673a5493e016ea6b07278e6 on neo4jrb:master.

coveralls avatar Jan 06 '15 11:01 coveralls

Coverage Status

Coverage decreased (-0.06%) when pulling 9a69115616333f3e6bf6679df1de64efec6e87f3 on dpisarewski:invalid_transactions into aa6934521083c935e673a5493e016ea6b07278e6 on neo4jrb:master.

coveralls avatar Jan 06 '15 12:01 coveralls

Coverage Status

Coverage decreased (-0.03%) when pulling 10f0c26a976f5fddfda0ac0e91be5060d9ff0268 on dpisarewski:invalid_transactions into aa6934521083c935e673a5493e016ea6b07278e6 on neo4jrb:master.

coveralls avatar Jan 06 '15 12:01 coveralls

./spec/neo4j-server/rest/create_node_spec.rb can be deleted or rewritten. I don't know why it's using HTTParty directly. I'm not sure what it's trying to demonstrate that isn't already proven elsewhere.

subvertallchris avatar Jan 06 '15 15:01 subvertallchris

Make sure you run the neo4j gem's master branch tests using your branch of core, too. It does a lot of transaction tests. That tx = Neo4j::Transaction.new thing is gonna pop up there.

subvertallchris avatar Jan 06 '15 15:01 subvertallchris