Skip to content

Conversation

@Mpdreamz
Copy link
Member

It was setting additional values in the integration setup on the class
itself but this setup is run once for possibly multiple classes e.g

EndpointUsage x;
new TestClass(x).Test1();
new TestClass(x).Test2();
new TestClass(x).Test3();
new TestClass(x).Test4();
new TestClass(x).Test5();

integration setup is an override per TestClass but only one of them will
be called per instance of x. So if the callback defines setting
variables on the TestClass instance using this other TestClass
instances won't see this.

This PR makes CallIsolatedValues a class of its own that allows you to
register extended values that can be shared amongst all TestClass
instances.

It was setting additional values in the integration setup on the class
itself but this setup is run once for possibly multiple classes e.g

EndpointUsage x;
new TestClass(x).Test1();
new TestClass(x).Test2();
new TestClass(x).Test3();
new TestClass(x).Test4();
new TestClass(x).Test5();

integration setup is an override per TestClass but only one of them will
be called per instance of `x`. So if the callback defines setting
variables on the `TestClass` instance using `this` other TestClass
instances won't see this.

This PR makes CallIsolatedValues a class of its own that allows you to
register extended values that can be shared amongst all TestClass
instances.
protected IDictionary<string, TaskId> SetupTaskIds { get; } = new Dictionary<string, TaskId>();

protected override void BeforeAllCalls(IElasticClient client, IDictionary<ClientMethod, string> values)
protected override void IntegrationSetup(IElasticClient client, CallUniqueValues values)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the rename. Makes it clear that this is only applies to integration tests.

@gmarz
Copy link
Contributor

gmarz commented Apr 12, 2016

LGTM!

@gmarz gmarz merged commit 8b71b98 into 2.x Apr 12, 2016
@gmarz gmarz deleted the fix/task-cancel-test-flakeyness branch April 12, 2016 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants