• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sonus21 / rqueue / 2317

pending completion
2317

push

circleci

Spring Boot 3.x support

* test fixes

* udate version

* update version

* update version

* added release script

* do not schedule message if job is terminated

* change condition to cater message deletion

* log deleted message as info

* Fixes
* Message deletion happening from Message listener
* Task rejected when threads are not available, sleep instead of poll

* retry test

* add gradle retry plugin

* increase failure count to 30

* enhance logging for TestMessageProcessor

* configure retry for all packages

* configure retry for all packages

* resource was not getting released due to sleep in the deactivate method

* use log level info

* depends on         reactive_integration_test

* use  @TestInstance(Lifecycle.PER_CLASS)

* remove TestPer class

* display date time at the bottom in default timezone

* shutdown executor

* 2.13.0 release

* use higher size vm

* use xlarge vm

* use 02 ubuntu

* use 01 and large only

* Boot 3.x preparation

* removed deprecated code flow

* add a default constructor

* change redis script

* install redis-server directly

* hibernate dependency issue

* 404 and message object issue.

* 404

* wip

* upgrade gradle dependencies

* missing reports

* added some more test cases

* give 6 gb ram

* renamed root project name

* copyright update

* Syntax issue due to IDE save option

* 3.0.0 release

* disable module file

* Fixed template syntax error

298 of 298 new or added lines in 15 files covered. (100.0%)

5373 of 5873 relevant lines covered (91.49%)

0.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/TimeoutUtils.java
1
/*
2
 * Copyright (c) 2020-2023 Sonu Kumar
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * You may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     https://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and limitations under the License.
14
 *
15
 */
16

17
package com.github.sonus21.rqueue.utils;
18

19
import com.github.sonus21.rqueue.exception.TimedOutException;
20
import java.util.function.BooleanSupplier;
21

22
/**
23
 * waitFor method wait for some event to occur. It accepts a callback as well that can be invoked on
24
 * successive failure of the method. That can be used to diagnosis the test. A callback method is
25
 * used to identify the outcome of some event, if the specified method returns true then call is
26
 * stopped otherwise every 100Ms the callback would be called to get the outcome. It tries for
27
 * continuously over 10seconds If callback does not return true within 10 seconds then it will throw
28
 * TimeOutException. If postmortem method is provided then it will call that method before throwing
29
 * exception.
30
 */
31
public final class TimeoutUtils {
32

33
  public static final long EXECUTION_TIME = 10_000L;
34
  public static final long SLEEP_TIME = 100L;
35

36
  private TimeoutUtils() {
37
  }
38

39
  public static void waitFor(
40
      BooleanSupplier callback, long waitTimeInMilliSeconds, String description)
41
      throws TimedOutException {
42
    waitFor(callback, waitTimeInMilliSeconds, SLEEP_TIME, description, () -> {
1✔
43
    });
×
44
  }
1✔
45

46
  public static void waitFor(BooleanSupplier callback, String description)
47
      throws TimedOutException {
48
    waitFor(callback, EXECUTION_TIME, description);
1✔
49
  }
1✔
50

51
  public static void waitFor(BooleanSupplier callback, String description, Runnable postmortem)
52
      throws TimedOutException {
53
    waitFor(callback, EXECUTION_TIME, SLEEP_TIME, description, postmortem);
1✔
54
  }
1✔
55

56
  public static void waitFor(
57
      BooleanSupplier callback,
58
      long waitTimeInMilliSeconds,
59
      String description,
60
      Runnable postmortem)
61
      throws TimedOutException {
62
    waitFor(callback, waitTimeInMilliSeconds, SLEEP_TIME, description, postmortem);
1✔
63
  }
1✔
64

65
  public static void waitFor(
66
      BooleanSupplier callback,
67
      long waitTimeInMilliSeconds,
68
      long sleepDuration,
69
      String description,
70
      Runnable postmortem)
71
      throws TimedOutException {
72
    long endTime = System.currentTimeMillis() + waitTimeInMilliSeconds;
1✔
73
    do {
74
      if (Boolean.TRUE.equals(callback.getAsBoolean())) {
1✔
75
        return;
1✔
76
      }
77
      sleep(sleepDuration);
1✔
78
    } while (System.currentTimeMillis() < endTime);
1✔
79
    try {
80
      postmortem.run();
×
81
    } catch (Exception e) {
×
82
      e.printStackTrace();
×
83
    }
×
84
    throw new TimedOutException("Timed out waiting for " + description);
×
85
  }
86

87
  public static void sleep(long time) {
88
    sleepLog(time, true);
1✔
89
  }
1✔
90

91
  public static void sleepLog(long time, boolean log) {
92
    try {
93
      Thread.sleep(time);
1✔
94
    } catch (InterruptedException e) {
1✔
95
      Thread.currentThread().interrupt();
1✔
96
      if (log) {
1✔
97
        e.printStackTrace();
×
98
      }
99
    }
1✔
100
  }
1✔
101
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc