DataLoader in Tests: A good idea to verify number of calls? #1350
Unanswered
bjoernmayer
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
I was able to get the test running by using |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Heyho,
I have a test that fails, if I execute all test methods.
If I execute the failing method only, it succeeds.
I thought caching might be the problem, but disabling it for the Dataloader didn't help.
The part that fails is a verification for number of calls to our actual datasource.
In theory it should be called only once, because batching.
In the test it appears to be called twice.
Now the odd part:
I gave up finding an error in our implementation and change the verification to be for two calls.
Guess what:
I fails again, because the datasource was called once
Is it a good idea to verify this number?
Is DGS invoking the Dataloaders sometimes as batches and sometimes seperately?
Beta Was this translation helpful? Give feedback.
All reactions