Skip to content

Commit f519601

Browse files
committed
RuboCop.
1 parent 25c1727 commit f519601

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

test/async/service/monitor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
with "#run_once" do
3535
it "does nothing by default" do
36-
expect { monitor.run_once }.not.to raise_exception
36+
expect{monitor.run_once}.not.to raise_exception
3737
end
3838
end
3939

test/async/service/utilization_monitor.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -438,17 +438,17 @@
438438
# 3. Write a value and confirm the supervisor can read it.
439439
# 4. Force a resize by registering a second worker (free list is empty → resize).
440440
# 5. Write a new value from the first worker and confirm the supervisor still reads it.
441-
441+
442442
initial_size = page_size # gives exactly page_size / segment_size segments
443443
segments_per_page = page_size / segment_size
444-
444+
445445
small_monitor = subject.new(
446446
path: File.join(root, "utilization.shm"),
447447
interval: 1,
448448
size: initial_size,
449449
segment_size: segment_size
450450
)
451-
451+
452452
# Fill all but one segment so the free list has exactly one slot left.
453453
# (Skip this loop when segments_per_page == 1 — the first worker will itself
454454
# consume the only slot and the second will trigger the resize.)
@@ -469,17 +469,17 @@
469469
filler_controllers << filler_controller
470470
small_monitor.register(filler_controller)
471471
end
472-
472+
473473
# Register the worker-under-test — it takes the last free segment and
474474
# maps the file at its current (pre-resize) size.
475475
small_monitor.register(supervisor_controller)
476476
worker_registry.metric(:connections_total).set(42)
477477
worker_registry.metric(:connections_active).set(7)
478-
478+
479479
status_before = small_monitor.status
480480
expect(status_before[:data]).to have_keys("test_service")
481481
expect(status_before[:data]["test_service"][:connections_total]).to be == 42
482-
482+
483483
# Now trigger a resize: register one more worker — the free list is empty
484484
# so SegmentAllocator#allocate will call resize before handing out a slot.
485485
resize_registry = Async::Utilization::Registry.new
@@ -494,25 +494,25 @@
494494
resize_controller.define_singleton_method(:id){999}
495495
resize_controller.define_singleton_method(:state){{name: "filler"}}
496496
resize_controller.define_singleton_method(:worker){resize_worker}
497-
497+
498498
size_before_resize = small_monitor.instance_variable_get(:@allocator).size
499499
small_monitor.register(resize_controller)
500500
size_after_resize = small_monitor.instance_variable_get(:@allocator).size
501-
501+
502502
# Confirm the resize actually happened
503503
expect(size_after_resize).to be > size_before_resize
504-
504+
505505
# The pre-resize worker must still be able to write through its Observer
506506
# and have the supervisor read the updated value.
507507
worker_registry.metric(:connections_total).set(99)
508508
worker_registry.metric(:connections_active).set(3)
509-
509+
510510
status_after = small_monitor.status
511511
expect(status_after[:data]).to have_keys("test_service")
512512
expect(status_after[:data]["test_service"][:connections_total]).to be == 99
513513
expect(status_after[:data]["test_service"][:connections_active]).to be == 3
514514
end
515-
515+
516516
with "#run" do
517517
include Sus::Fixtures::Async::SchedulerContext
518518

0 commit comments

Comments
 (0)