power_assert icon indicating copy to clipboard operation
power_assert copied to clipboard

`power_assert` didn't show `.class` result sometimes with Ruby 3.4

Open hsbt opened this issue 8 months ago • 6 comments

I faced flaky result with Ruby 3.4.2 and power_assert.

https://github.com/hsbt/minitest-power_assert/actions/runs/13891945806/job/38865298257

# success
❯ rake test
Run options: --seed 18518

# Running:

.    assert { "0".class == "3".to_i.times.map {|i| i + 1 }.class }
                 |     |      |    |     |                |
                 |     |      |    |     |                Array
                 |     |      |    |     [1, 2, 3]
                 |     |      |    #<Enumerator: 3:times>
                 |     |      3
                 |     false
                 String
.......

Finished in 0.029726s, 269.1247 runs/s, 672.8117 assertions/s.

8 runs, 20 assertions, 0 failures, 0 errors, 0 skips
# failed 
❯ rake test
Run options: --seed 57838

# Running:

....    assert { "0".class == "3".to_i.times.map {|i| i + 1 }.class }
                       |      |    |     |
                       |      |    |     [1, 2, 3]
                       |      |    #<Enumerator: 3:times>
                       |      3
                       false
F...

Finished in 0.030614s, 261.3184 runs/s, 653.2959 assertions/s.

The above issue is happend with one out of every five fails.

hsbt avatar Mar 17 '25 05:03 hsbt

@k-tsj Is it okay to release 3.0.0 from the current master branch? We have a plan to next preview release after next week. It's good time to next release.

hsbt avatar Oct 29 '25 08:10 hsbt

@hsbt I'll release 3.0.0 this weekend. (I want to update the doc before that)

k-tsj avatar Oct 30 '25 00:10 k-tsj

@hsbt Released: https://github.com/ruby/power_assert/releases/tag/v3.0.0

k-tsj avatar Nov 02 '25 14:11 k-tsj

@k-tsj Thanks! Unfortunately, I still got the flaky result with 3.0.0: https://github.com/hsbt/minitest-power_assert/actions/runs/19058217831/job/54432734168

I forgot to root cause of this issue. Is it fixed at 3.0.0?

hsbt avatar Nov 04 '25 05:11 hsbt

Is it fixed at 3.0.0?

No, because it looks like a VM bug. For more details, please search for the keyword “power_assert vm_call_single_noarg_leaf_builtin” in ruby-lang slack.

I'll take a look when I have some time, but I can’t promise anything...

cc: @ko1

k-tsj avatar Nov 04 '25 09:11 k-tsj

🙏 Thanks for your explanation. It's not rush things, I will add the workaround to minitest-power_assert.

hsbt avatar Nov 04 '25 09:11 hsbt