hawkular / hawkular-client-ruby

Ruby client for Hawkular
http://hawkular.org/
Apache License 2.0
8 stars 28 forks source link

[hawkular-1259] Websocket: use dedicated 'senderRequestId' to match req & res #240

Closed jotak closed 6 years ago

jotak commented 6 years ago

Fixes test on concurrent operation 'restart'.

Before, matching WS response with request was done through matching resource ID and operation name. That worked quite fortunately as long as there's no several messages sent concurrently on same resource with same operation name.

Now, it uses a special field that already exists in the CMDGW api, exactly for this purpose: senderRequestId. I think it's much safer, but on another hand, WS cassettes now need to generate a fixed ID in senderRequestId so that recorded message and replayed message can match.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.2%) to 96.774% when pulling a8f724583ec90a452645c945bc85d6b9eb772786 on jotak:ws-use-reqid into 0b4a39e52a12269d0bbae1d24f59a308a0b35d8e on hawkular:hawkular-1259.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.05%) to 97.043% when pulling 418ec8236ba5a7c272cdecc0aff67c5813e96c67 on jotak:ws-use-reqid into 0b4a39e52a12269d0bbae1d24f59a308a0b35d8e on hawkular:hawkular-1259.

jotak commented 6 years ago

@israel-hdez , I still have a failing test on JDR export which seems related to the issue you addressed previously: https://github.com/hawkular/hawkular-client-ruby/commit/bb914bf807000cca7329280f5c8168fcf1e725b0

I have two errors there:

  1. expected "..." to respond to blank? We talked about it previously (also with @cfcosta ), I don't remember which file I would have to require and anyway I don't see why I would need to require an extra file if the test worked before with you.

  2. Encoding::UndefinedConversionError: "\xAE" from ASCII-8BIT to UTF-8 in simple_websocket_vcr, while writing down the record to file. Didn't you had the same issue while recording?

Can you give a little help here please?

israel-hdez commented 6 years ago

@jotak To have blank defined, add this line: require 'active_support/core_ext/object/blank' to lib/hawkularclient.rb. That should solve it. Not sure why it's not being required as before.

The error about the encoding... Yes, I had that error, but I solved it in this patch: https://github.com/Jiri-Kremser/simple-websocket-vcr/commit/1d8d6adb52248b8fbc08da7b87be19d11bc6e3f1. Make sure that you have version 0.1.0 of simple-websocket-vcr gem. If you have it, maybe there is another bug on it.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.05%) to 97.044% when pulling 8a90535223efeaa2fdf2e715754de8e1493f41db on jotak:ws-use-reqid into 0b4a39e52a12269d0bbae1d24f59a308a0b35d8e on hawkular:hawkular-1259.

jotak commented 6 years ago

@israel-hdez ok, my dependencies were out of date, that was causing the issues. Should be better now.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.05%) to 97.043% when pulling daa2d1062960ad2a13c700fe8220177811f3c937 on jotak:ws-use-reqid into 0b4a39e52a12269d0bbae1d24f59a308a0b35d8e on hawkular:hawkular-1259.

jotak commented 6 years ago

Could it be merged?

israel-hdez commented 6 years ago

Any idea about why travis is failing when using the cassettes? I wouldn't like to merge to master with all the tests failing with vcr.