eiri opened a new pull request #1273: Adopt fake_db to PSE changes
URL: https://github.com/apache/couchdb/pull/1273
 
 
   ## Overview
   
   With db headers moved into engine's state, any `fake_db` call that is trying 
to setup sequences for tests (e.g. in mem3_shards) crashing with context setup 
failed.
   
   It's not trivial to compose a proper `engine` field outside of couch app, so 
instead this fix makes `fake_db` to set engine transparently, unless it 
provided explicitly in a payload.
   
   ## Testing recommendations
   
   Without this change running `make eunit apps=mem3 suites=mem3_shards` would 
crash with 
   
   ```
   ...
       *** context setup failed ***
   **in function erlang:setelement/3
     called as setelement(undefined,{db,1,<<"dbs">>,undefined,
       {couch_bt_engine,undefined},
       nil,nil,undefined,undefined,
       {user_ctx,null,[],undefined},
       [],undefined,nil,nil,...},0)
   in call from test_util:'-fake_db/1-fun-0-'/3 (src/test_util.erl, line 244)
   in call from lists:foldl/3 (lists.erl, line 1261)
   in call from mem3_shards:setup_changes/0 (src/mem3_shards.erl, line 738)
   **error:badarg
     [done in 1.194 s]
   =======================================================
     Failed: 0.  Skipped: 0.  Passed: 10.
   ```
   
   This was not exposed by travis because in eunit crash in context setup 
doesn't count as a failure.
   
   With this change the same command should pass successfully with `All 11 
tests passed.`
   
   ## Checklist
   
   - [x] Code is written and works correctly;
   - [x] Changes are covered by tests;
   - [ ] Documentation reflects the changes;
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to