File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -744,10 +744,11 @@ fn testCounterAddingOne(counter: *Counter(u64)) !void {
744
744
745
745
fn testCounterCollect (counter : * Counter (u64 )) ! void {
746
746
// FIXME flaky test can result in failure, so we added a sleep but we should find a more robust solution.
747
- while (! counter .lock .tryLock ()) {
748
- std .time .sleep (44 );
747
+ for (0.. 1000) | _ | {
748
+ counter .lock .lock ();
749
+ counter .lock .unlock ();
750
+ std .time .sleep (25 );
749
751
}
750
- counter .lock .unlock ();
751
752
752
753
const fetched = try counter .measurementsData (std .testing .allocator );
753
754
defer {
@@ -789,10 +790,11 @@ fn testHistogramRecordOne(histogram: *Histogram(u64)) !void {
789
790
790
791
fn testHistogramCollect (histogram : * Histogram (u64 )) ! void {
791
792
// FIXME flaky test can result in failure, so we added a sleep but we should find a more robust solution.
792
- while (! histogram .lock .tryLock ()) {
793
- std .time .sleep (44 );
793
+ for (0.. 1000) | _ | {
794
+ histogram .lock .lock ();
795
+ histogram .lock .unlock ();
796
+ std .time .sleep (25 );
794
797
}
795
- histogram .lock .unlock ();
796
798
797
799
const fetched = try histogram .measurementsData (std .testing .allocator );
798
800
defer {
You can’t perform that action at this time.
0 commit comments