Skip to content

Commit

Permalink
github actions is sometimes slow, increase timeout for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Athou committed Aug 19, 2024
1 parent ac1a927 commit dc25d53
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@
import com.commafeed.backend.service.FeedEntryFilteringService.FeedEntryFilterException;

class FeedEntryFilteringServiceTest {
private CommaFeedConfiguration config;

private FeedEntryFilteringService service;

private FeedEntry entry;

@BeforeEach
public void init() {
CommaFeedConfiguration config = Mockito.mock(CommaFeedConfiguration.class, Mockito.RETURNS_DEEP_STUBS);
Mockito.when(config.feedRefresh().filteringExpressionEvaluationTimeout()).thenReturn(Duration.ofSeconds(2));
config = Mockito.mock(CommaFeedConfiguration.class, Mockito.RETURNS_DEEP_STUBS);
Mockito.when(config.feedRefresh().filteringExpressionEvaluationTimeout()).thenReturn(Duration.ofSeconds(30));

service = new FeedEntryFilteringService(config);

Expand Down Expand Up @@ -69,6 +70,9 @@ void dotClassIsDisabled() throws FeedEntryFilterException {

@Test
void cannotLoopForever() {
Mockito.when(config.feedRefresh().filteringExpressionEvaluationTimeout()).thenReturn(Duration.ofMillis(200));
service = new FeedEntryFilteringService(config);

Assertions.assertThrows(FeedEntryFilterException.class, () -> service.filterMatchesEntry("while(true) {}", entry));
}

Expand Down

0 comments on commit dc25d53

Please sign in to comment.