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 fragile and crashing specs on macOS #1041

Merged
merged 1 commit into from
Apr 27, 2019

Conversation

felixbuenemann
Copy link
Contributor

  • Use monotonic time if possible to guard against clock skew
  • Relax time comparisons to make test failures under load less likely
  • Fix memory corruption segfaults on macOS due to mixing Threads and Timeout

Without the timeout thread safety fix, the specs always crash in the
"threaded queries should be supported" spec for various reasons on
macOS 10.14.4 with ruby 2.6.1 / MySQL 8.0.15.

Some observed errors:

malloc: *** error for object 0x7fcbba90ef80: pointer being freed was not allocated
malloc: *** set a breakpoint in malloc_error_break to debug

lib/mysql2/client.rb:131:in `_query': Bad file descriptor (Errno::EBADF)

Now specs run fine, even during Prime95 load test on i9-8950HK (6c/12t).

* Use monotonic time if possible to guard against clock skew
* Relax time comparisons to make test failures under load less likely
* Fix memory corruption segfaults on macOS due to mixing Threads and Timeout

Without the timeout thread safety fix, the specs always crash in the
"threaded queries should be supported" spec for various reasons on
macOS 10.14.4 with ruby 2.6.1 / MySQL 8.0.15.

Some observed errors:

    malloc: *** error for object 0x7fcbba90ef80: pointer being freed was not allocated
    malloc: *** set a breakpoint in malloc_error_break to debug

    lib/mysql2/client.rb:131:in `_query': Bad file descriptor (Errno::EBADF)

Now specs run fine, even during Prime95 load test on i9-8950HK (6c/12t).
@sodabrew
Copy link
Collaborator

I think you meant comment #1040 (comment) on this PR - merging in PR order.

@sodabrew sodabrew merged commit c8c346d into brianmario:master Apr 27, 2019
@sodabrew sodabrew added this to the 0.5.3 milestone Apr 27, 2019
@felixbuenemann felixbuenemann deleted the fix-fragile-specs branch April 29, 2019 06:34
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