<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/-ext-/thread/test_instrumentation_api.rb, branch v3_2_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>GVL Instrumentation: remove the EXITED count assertion</title>
<updated>2022-07-13T17:39:31+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2022-07-13T16:49:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=664c23db79dd0d500a834ef0ec8da443d95ddfd6'/>
<id>664c23db79dd0d500a834ef0ec8da443d95ddfd6</id>
<content type='text'>
It's very flaky for some unknown reason. Something we have
an extra EXITED event. I suspect some other test is causing this.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's very flaky for some unknown reason. Something we have
an extra EXITED event. I suspect some other test is causing this.
</pre>
</div>
</content>
</entry>
<entry>
<title>thread/test_instrumentation_api: cleanup all existing threads in setup</title>
<updated>2022-07-13T12:13:41+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2022-07-13T11:13:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=268269687c8747eb0bb67b09025b7ff7f495eba6'/>
<id>268269687c8747eb0bb67b09025b7ff7f495eba6</id>
<content type='text'>
We saw the following failure:
```
TestThreadInstrumentation#test_thread_instrumentation [/tmp/ruby/v3/src/trunk-random3/test/-ext-/thread/test_instrumentation_api.rb:25]:
Expected 0..3 to include 4.
```

Which shouldn't happen unless somehow there was a leaked thread.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We saw the following failure:
```
TestThreadInstrumentation#test_thread_instrumentation [/tmp/ruby/v3/src/trunk-random3/test/-ext-/thread/test_instrumentation_api.rb:25]:
Expected 0..3 to include 4.
```

Which shouldn't happen unless somehow there was a leaked thread.
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor tests for ThreadInstrumentation counters</title>
<updated>2022-07-12T10:43:11+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-07-10T04:01:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0f8a0c5f371b0886e8e31e35a9095bc9843de27c'/>
<id>0f8a0c5f371b0886e8e31e35a9095bc9843de27c</id>
<content type='text'>
* Extracted some assertions.
* Assert counter values should be positive.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Extracted some assertions.
* Assert counter values should be positive.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use `IO.popen` to fork and exit the child process without cleanup</title>
<updated>2022-07-12T10:43:11+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-07-10T04:01:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a6e2f3fd8d98e511e4e2011bc1a45ba1bd9144a1'/>
<id>a6e2f3fd8d98e511e4e2011bc1a45ba1bd9144a1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Relax assertion condition for thread local counters</title>
<updated>2022-07-08T01:55:44+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-07-08T01:41:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f1c15f3e941192b2230035ce2aab29c3d6970fca'/>
<id>f1c15f3e941192b2230035ce2aab29c3d6970fca</id>
<content type='text'>
Recently `TestThreadInstrumentation#test_join_counters` often fails as

```
&lt;[1, 1, 1]&gt; expected but was
&lt;[2, 2, 2]&gt;.
```

Probably it seems that the thread is suspended more than once.
There may be no guarantee that the subject thread never be suspended
more than once.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Recently `TestThreadInstrumentation#test_join_counters` often fails as

```
&lt;[1, 1, 1]&gt; expected but was
&lt;[2, 2, 2]&gt;.
```

Probably it seems that the thread is suspended more than once.
There may be no guarantee that the subject thread never be suspended
more than once.
</pre>
</div>
</content>
</entry>
<entry>
<title>thread_pthread.c: call SUSPENDED event when entering native_sleep</title>
<updated>2022-07-07T15:49:00+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2022-07-07T13:20:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=587d2d199b3f783d03266d42d066949f8a4824d3'/>
<id>587d2d199b3f783d03266d42d066949f8a4824d3</id>
<content type='text'>
[Bug #18900]

Thread#join and a few other codepaths are using native sleep as
a way to suspend the current thread. So we should call the relevant
hook when this happen, otherwise some thread may transition
directly from `RESUMED` to `READY`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #18900]

Thread#join and a few other codepaths are using native sleep as
a way to suspend the current thread. So we should call the relevant
hook when this happen, otherwise some thread may transition
directly from `RESUMED` to `READY`.
</pre>
</div>
</content>
</entry>
<entry>
<title>test_instrumentation_api.rb: Allow one less exit</title>
<updated>2022-06-20T11:03:39+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2022-06-20T11:03:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c46824d0945c95172951a904f09c774b99a4deb3'/>
<id>c46824d0945c95172951a904f09c774b99a4deb3</id>
<content type='text'>
I suspect that sometimes on CI the last thread is prempted before eaching the exit hook
causing the test to flake. I can't find a good way to force it to run.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I suspect that sometimes on CI the last thread is prempted before eaching the exit hook
causing the test to flake. I can't find a good way to force it to run.
</pre>
</div>
</content>
</entry>
<entry>
<title>Scale the time to wait native threads to run hook</title>
<updated>2022-06-19T14:33:26+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-06-19T14:33:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=da362fee59b2bff30eb8d63ee15724f5c3aac957'/>
<id>da362fee59b2bff30eb8d63ee15724f5c3aac957</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Debug TestThreadInstrumentation</title>
<updated>2022-06-17T13:11:10+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2022-06-17T08:09:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c34a5469c8d53029a5f3cdde0ca855e47a92c7d7'/>
<id>c34a5469c8d53029a5f3cdde0ca855e47a92c7d7</id>
<content type='text'>
It previously failed with:

```
    1) Failure:
  TestThreadInstrumentation#test_thread_instrumentation_fork_safe [/home/runner/work/ruby/ruby/src/test/-ext-/thread/test_instrumentation_api.rb:50]:
  &lt;5&gt; expected but was
  &lt;4&gt;.
```

Suggesting one `EXIT` event wasn't fired or processed.

Adding an assetion on `Thead#status` may help figure out what is wrong.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It previously failed with:

```
    1) Failure:
  TestThreadInstrumentation#test_thread_instrumentation_fork_safe [/home/runner/work/ruby/ruby/src/test/-ext-/thread/test_instrumentation_api.rb:50]:
  &lt;5&gt; expected but was
  &lt;4&gt;.
```

Suggesting one `EXIT` event wasn't fired or processed.

Adding an assetion on `Thead#status` may help figure out what is wrong.
</pre>
</div>
</content>
</entry>
<entry>
<title>GVL Instrumentation API: add STARTED and EXITED events</title>
<updated>2022-06-17T07:08:26+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2022-06-15T12:37:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b6c1e1158d71b533b255ae7a2731598455918071'/>
<id>b6c1e1158d71b533b255ae7a2731598455918071</id>
<content type='text'>
[Feature #18339]

After experimenting with the initial version of the API I figured there is a need
for an exit event to cleanup instrumentation data. e.g. if you record data in a
{thread_id -&gt; data} table, you need to free associated data when a thread goes away.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Feature #18339]

After experimenting with the initial version of the API I figured there is a need
for an exit event to cleanup instrumentation data. e.g. if you record data in a
{thread_id -&gt; data} table, you need to free associated data when a thread goes away.
</pre>
</div>
</content>
</entry>
</feed>
