File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -201,7 +201,16 @@ func TestServer(t *testing.T) {
201
201
go func () {
202
202
errCh <- inv .WithContext (ctx ).Run ()
203
203
}()
204
- pty .ExpectMatch ("Using an ephemeral deployment directory" )
204
+ matchCh1 := make (chan string , 1 )
205
+ go func () {
206
+ matchCh1 <- pty .ExpectMatchContext (ctx , "Using an ephemeral deployment directory" )
207
+ }()
208
+ select {
209
+ case err := <- errCh :
210
+ require .NoError (t , err )
211
+ case <- matchCh1 :
212
+ // OK!
213
+ }
205
214
rootDirLine := pty .ReadLine (ctx )
206
215
rootDir := strings .TrimPrefix (rootDirLine , "Using an ephemeral deployment directory" )
207
216
rootDir = strings .TrimSpace (rootDir )
@@ -210,7 +219,16 @@ func TestServer(t *testing.T) {
210
219
require .NotEmpty (t , rootDir )
211
220
require .DirExists (t , rootDir )
212
221
213
- pty .ExpectMatchContext (ctx , "View the Web UI" )
222
+ matchCh2 := make (chan string , 1 )
223
+ go func () {
224
+ matchCh2 <- pty .ExpectMatchContext (ctx , "View the Web UI" )
225
+ }()
226
+ select {
227
+ case err := <- errCh :
228
+ require .NoError (t , err )
229
+ case <- matchCh2 :
230
+ // OK!
231
+ }
214
232
215
233
cancelFunc ()
216
234
<- errCh
You can’t perform that action at this time.
0 commit comments