Skip to content

Commit

Permalink
Add some sleeps to sleepy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Moynes committed Dec 1, 2023
1 parent 932f01a commit 653cad0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/monitor/traps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func TestTrap_Out(tt *testing.T) {

break
} else if machine.PC > 0x3001 {
t.Log("Stepped to user code")
t.Log("Instruction completed")
cancel()

break
Expand All @@ -183,8 +183,9 @@ func TestTrap_Out(tt *testing.T) {
}
}

<-ctx.Done()
cancel()
<-ctx.Done()
time.Sleep(time.Millisecond)
close(displayed)

vals := make([]uint16, 0, len(displayed))
Expand Down Expand Up @@ -227,7 +228,7 @@ func TestTrap_Puts(tt *testing.T) {
},
}

ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond)
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
displayed := make(chan uint16, 10)
machine := vm.New(
WithSystemImage(&image),
Expand Down Expand Up @@ -286,6 +287,7 @@ func TestTrap_Puts(tt *testing.T) {

cancel()
<-ctx.Done()
time.Sleep(time.Millisecond)
close(displayed)

vals := make([]uint16, 0, len(displayed))
Expand Down

0 comments on commit 653cad0

Please sign in to comment.