[SERVER-47535] Ability to mock command responses on the server Created: 14/Apr/20 Updated: 04/Jun/20 Resolved: 04/Jun/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Testing Infrastructure |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Tomer Yakir | Assignee: | Benjamin Caimano (Inactive) |
| Resolution: | Won't Fix | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
Some tests require reproduction of non-trivial conditions such as network instability between cluster members. |
| Comments |
| Comment by Eric Milkie [ 14/Apr/20 ] | ||
|
My second proposal is to set up a failpoint with the response it needs to return for the command. It can be made more complicated (choose the command to return the response; modify part of the response; et cetera). The failpoint command logic has a way to pass a BSONObj that can be used for this, or we can come up with a new command like the one I proposed above. | ||
| Comment by Eric Milkie [ 14/Apr/20 ] | ||
|
A more complicated and featureful way to do this in two steps would be something like:
| ||
| Comment by Eric Milkie [ 14/Apr/20 ] | ||
|
Would something like a "reflect" feature work, where you could turn on a failpoint (or not, even), and then do something like this:
|