Comments (12)
@Fryguy this test? https://github.com/ManageIQ/manageiq-cross_repo-tests/runs/6692135533?check_suite_focus=true#step:6:2265
Seems to still be an issue, I do see it occasionally on PRs as well
from manageiq-api.
it failed at the time for this seed consistently...it's possible things have changed and we have to find a new seed.
from manageiq-api.
@Fryguy do you remember if this always failed for the seed, or if this is just plain sporadic.
Unfortunately, this is working for me.
from manageiq-api.
tried 3 times, will try some more. These are all passing for me for now.
for i in {1..20} ; do be rspec spec/requests/authentication_spec.rb || break ; done
(not sure if the break
will successfully kick in, so just running 20 times a pop.)
It is taking 25s per iteration - so 10 minutes for the loop to run.
from manageiq-api.
I'm pretty sure I saw this recently - wish I had recorded the seed π
from manageiq-api.
Hmmm - maybe not - don't see anything in GitHub Actions. Maybe it's fixed.
from manageiq-api.
I'm gonna close - I also can't reproduce with the given seed, and I also ran it 100 times locally.
from manageiq-api.
I can't reproduce directly with seed 2979 as seen in that link...perhaps it needs more files?
from manageiq-api.
ok, so I looked at this and the only way I can see this is happening is if the return from token_get_info
is an empty hash or a hash without token_ttl key:
manageiq-api/app/controllers/api/auth_controller.rb
Lines 9 to 12 in 67eec89
This can happen in a few scenarios:
- token_valid? is false (nil token, empty string, or not found in the token_store)
- Note: a nil return here would cause the calling method to blow up with undefined method [] for nil, which isn't happening. So, it's not line 44
- reading the token is returning an empty hash {}
With this knowledge, it must be a contamination or timing issue where we're either sporadically using an invalid token for these failing examples or we read the token and it's empty. Perhaps this is a timing problem on ActionDispatch::Session::MemoryStore
or more likely, we're stubbing or caching the various things such as token manager or the token store and some state changes are retained across tests.
I am unable to find a seed that recreates this issue so it's hard to track things down. I do wonder if resetting the caches such as we do in the users_spec would help.
from manageiq-api.
Note, the prior comment is in regards to a recent failure in github actions on a cross repo. It's important to note, it's still using memory store:
** override_gem("manageiq-ui-classic", :path=>"/home/runner/work/manageiq-cross_repo-tests/manageiq-cross_repo-tests/repos/ManageIQ/manageiq-ui-classic@35401b4006f98665f75a9675e13bfff7332ab0ef") at /home/runner/work/manageiq-cross_repo-tests/manageiq-cross_repo-tests/repos/ManageIQ/manageiq-api@0c841dcd5757445443a1bea64002fb0a2584cb7a/spec/manageiq/bundler.d/overrides.rb:1
** Using session_store: ActionDispatch::Session::MemoryStore
** ManageIQ master, codename: Oparin
** ManageIQ master, codename: Oparin
** override_gem("manageiq-ui-classic", :path=>"/home/runner/work/manageiq-cross_repo-tests/manageiq-cross_repo-tests/repos/ManageIQ/manageiq-ui-classic@35401b4006f98665f75a9675e13bfff7332ab0ef") at /home/runner/work/manageiq-cross_repo-tests/manageiq-cross_repo-tests/repos/ManageIQ/manageiq-api@0c841dcd5757445443a1bea64002fb0a2584cb7a/spec/manageiq/bundler.d/overrides.rb:1
** Using session_store: ActionDispatch::Session::MemoryStore
** ManageIQ master, codename: Oparin
Randomized with seed 19159
Top level ::CompositeIO is deprecated, require 'multipart/post' and use `Multipart::Post::CompositeReadIO` instead!
Top level ::Parts is deprecated, require 'multipart/post' and use `Multipart::Post::Parts` instead!
.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................F............F.............F...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Failures:
1) Authentication API Token Based Authentication when using a cache session store Tokens for Web Sockets gets a UI based token_ttl when requesting token for web sockets
Failure/Error: expect(response.parsed_body["token_ttl"]).to eq(::Settings.session.timeout.to_i_with_method)
expected: 3600
got: nil
(compared using ==)
# ./spec/requests/authentication_spec.rb:371:in `block (6 levels) in <top (required)>'
2) Authentication API Token Based Authentication when using a sql session store Tokens for Web Sockets gets a UI based token_ttl when requesting token for web sockets
Failure/Error: expect(response.parsed_body["token_ttl"]).to eq(::Settings.session.timeout.to_i_with_method)
expected: 3600
got: nil
(compared using ==)
# ./spec/requests/authentication_spec.rb:371:in `block (6 levels) in <top (required)>'
3) Authentication API Token Based Authentication when using a memory session store Tokens for Web Sockets gets a UI based token_ttl when requesting token for web sockets
Failure/Error: expect(response.parsed_body["token_ttl"]).to eq(::Settings.session.timeout.to_i_with_method)
expected: 3600
got: nil
(compared using ==)
# ./spec/requests/authentication_spec.rb:371:in `block (6 levels) in <top (required)>'
from manageiq-api.
@jrafanie nailed it. Or at least pointed to something that I want to resolve (if not the full solution): #1171
from manageiq-api.
Ok, so I am diving into a different spot for this spec.
Looking at comments from Nick around why that code was introduced in the first place.
It is possible there is a nil hanging around:
e5bc44c
I'm not able to reproduce Nick's example.
If this is not resolved, may want to look into using stub_settings_merge
instead of directly setting the session timeout
from manageiq-api.
Related Issues (20)
- Slow API requests part deux HOT 17
- Switch tag subcollection missing HOT 2
- Api for timeline charts. HOT 7
- Need API for Cloud Volume Snapshot Subcollection HOT 3
- Sporadic test failure in authentication_spec HOT 4
- vm_reconfigure request has no effect on vm params HOT 10
- Need Policy Simulation Endpoints for non-VM options HOT 2
- Template API Issue with child_resources HOT 5
- If a resource doesnβt come in as hash or `{}` return bad request error HOT 4
- API Interface Changes HOT 5
- Issue while creating a Custom Button with expression via API HOT 9
- Incorrect work of role accesses in API HOT 5
- New API endpoints HOT 2
- [OPARIN] API Interface Changes
- Add support for Native Console over the API /vm#request_console
- [RFE] Ability to change Catalog Item Request Info via API HOT 8
- Auth API action
- Can't create a user for multiple groups HOT 7
- Dependency Dashboard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from manageiq-api.