Skip to content
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

Fix data race in TestBlockingEnqueue #850

Merged
merged 1 commit into from
Mar 12, 2020

Conversation

yacovm
Copy link
Contributor

@yacovm yacovm commented Mar 12, 2020

In some tests we need to overwrite the mocks.Mock field
of the mock, however it could be that it is used concurrently
by other goroutines.

We use a lock to ensure mutual exclusion and memory cohesion,
and the mock methods lock before calling the mocked method.

The lock was only used upon demand and not consistently.

I made the lock to be always activated.

Change-Id: Iffd02f681b144d2456640922c4c5a6438109a40e
Signed-off-by: yacovm yacovm@il.ibm.com

In some tests we need to overwrite the mocks.Mock field
of the mock, however it could be that it is used concurrently
by other goroutines.

We use a lock to ensure mutual exclusion and memory cohesion,
and the mock methods lock before calling the mocked method.

The lock was only used upon demand and not consistently.

I made the lock to be always activated.

Change-Id: Iffd02f681b144d2456640922c4c5a6438109a40e
Signed-off-by: yacovm <yacovm@il.ibm.com>
@yacovm yacovm requested a review from a team as a code owner March 12, 2020 20:31
@C0rWin C0rWin merged commit db2e930 into hyperledger:master Mar 12, 2020
@yacovm yacovm deleted the TestBlockingEnqueue branch March 13, 2020 16:18
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.

2 participants