Skip to content

Commit 8990c54

Browse files
committed
Use Primitive.gc_force instead of GC.start in spec/truffle
1 parent aa0a082 commit 8990c54

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

spec/truffle/gc/time_spec.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# truffleruby_primitives: true
2+
13
# Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved. This
24
# code is released under a tri EPL/GPL/LGPL license. You can use it,
35
# redistribute it and/or modify it under the terms of the:
@@ -16,11 +18,7 @@
1618

1719
it "increases as collections are run" do
1820
time_before = GC.time
19-
i = 0
20-
while GC.time <= time_before and i < 10
21-
GC.start
22-
i += 1
23-
end
21+
Primitive.gc_force
2422
GC.time.should > time_before
2523
end
2624

spec/truffle/objspace/undefine_finalizer_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# truffleruby_primitives: true
2+
13
# Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved. This
24
# code is released under a tri EPL/GPL/LGPL license. You can use it,
35
# redistribute it and/or modify it under the terms of the:
@@ -25,7 +27,7 @@
2527
ObjectSpace.undefine_finalizer object
2628
ObjectSpace.reachable_objects_from(object).should_not include(finalizer)
2729
end
28-
GC.start
30+
Primitive.gc_force
2931
Truffle::Debug.drain_finalization_queue # Not needed for correctness
3032
channel.try_receive.should be_nil
3133
end

0 commit comments

Comments
 (0)