Skip to content

Commit cf3e166

Browse files
committed
Fix timeout in failing test
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
1 parent b4f7b98 commit cf3e166

File tree

2 files changed

+31
-17
lines changed

2 files changed

+31
-17
lines changed

modules/nextflow/src/main/groovy/nextflow/scm/RepositoryProvider.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ abstract class RepositoryProvider {
316316
return bytes ? new String(bytes) : null
317317
}
318318

319-
320319
/**
321320
* Validate the repository for the specified file.
322321
* It tries to read the content of the specified file throwing an {@link AbortOperationException} if it does not exist

modules/nextflow/src/test/groovy/nextflow/scm/BitbucketRepositoryProviderTest.groovy

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import spock.lang.Requires
2222
import spock.lang.Specification
2323
import spock.lang.Timeout
2424

25-
@Timeout(10)
25+
@Timeout(30)
2626
@IgnoreIf({System.getenv('NXF_SMOKE')})
2727
class BitbucketRepositoryProviderTest extends Specification {
2828

@@ -122,29 +122,44 @@ class BitbucketRepositoryProviderTest extends Specification {
122122
and:
123123
def repo = new BitbucketRepositoryProvider('pditommaso/tutorial', config)
124124

125-
expect:
126-
repo.readText('main.nf').contains('world')
127-
!repo.readText('main.nf').contains('WORLD')
125+
when:
126+
def data = repo.readText('main.nf')
127+
then:
128+
data.contains('world')
129+
!data.contains('WORLD')
128130

129-
and:
131+
when:
132+
sleep 1_000
130133
repo.setRevision('test-branch')
131-
repo.readText('main.nf').contains('world')
132-
!repo.readText('main.nf').contains('WORLD')
133-
134134
and:
135-
repo.setRevision('feature/with-slash')
136-
!repo.readText('main.nf').contains('world')
137-
repo.readText('main.nf').contains('WORLD')
135+
data = repo.readText('main.nf')
136+
then:
137+
data.contains('world')
138+
!data.contains('WORLD')
138139

140+
when:
141+
repo.setRevision('feature/with-slash')
139142
and:
140-
repo.setRevision('v1.1')
141-
repo.readText('main.nf').contains('world')
142-
!repo.readText('main.nf').contains('WORLD')
143+
data = repo.readText('main.nf')
144+
then:
145+
!data.contains('world')
146+
data.contains('WORLD')
143147

148+
when:
149+
repo.setRevision('v1.1')
144150
and:
151+
data = repo.readText('main.nf')
152+
then:
153+
data.contains('world')
154+
!data.contains('WORLD')
155+
156+
when:
145157
repo.setRevision('test/tag/v2')
146-
!repo.readText('main.nf').contains('world')
147-
repo.readText('main.nf').contains('mundo')
158+
and:
159+
data = repo.readText('main.nf')
160+
then:
161+
!data.contains('world')
162+
data.contains('mundo')
148163

149164
}
150165
}

0 commit comments

Comments
 (0)