-
Notifications
You must be signed in to change notification settings - Fork 232
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
No configuration required per thread (compatibility with timeliness 0.4.0+ #187
Comments
Thanks @timdiggins . Given you are loading the initializer explicitly I wonder if you are actually booting rails for these specs such the railties are loaded? The necessary step happens in the Railtie here
|
Hi @adzap The (re)loading of the initializer only happens after the specs-- it's to stop the specs from messing up with any others (in my full suite). I can remove it and it still runs... These lines prove the initializer is running:
The spec fails during Thread.join. I've put some debugging lines into my initializer and also the railtie (within validates_timeliness.initialize_timeliness_ambiguous_date_format) e.g.:
The output indicates that the railtie is running before. (This happens both in the specs, but also when I run
So is it possible that "engines_blank_point" is a better spot for hooking into than "load_config_initializers" (maybe the .after is not being respected?) |
Hmmm, weird. Even engines_blank_point is giving me the same ordered output. I can get the correct ordering only by changing it from an Maybe I should check that I can reproduce this in a vanilla rails project. Will share with you if I can (but won't be for a few days) |
@timdiggins how did you go with this? was it confirmed in vanilla Rails? |
@adzap I hadn't tried this out in vanilla rails, but I have now: timdiggins/validates-timeliness-issue-187@8d35a60 Still failing -- is there some flaw in my spec or config? |
Do you mind trying again against master? I changed the 'load_config_initializers' to symbol. I think I've run into this in the past. I will add a spec for this later. |
@adzap yes looks like master fixes this. |
Following on from adzap/timeliness#37...
I'm not seeing a fix for this in my spec (see below) for pre-threaded configuration / threadsafety.
Results:
My spec for this is as follows:
The text was updated successfully, but these errors were encountered: