Closed emil14 closed 1 month ago
Here's e2e
package test
import (
"os/exec"
"testing"
"github.com/stretchr/testify/require"
)
func Test(t *testing.T) {
cmd := exec.Command("neva", "run", "main")
out, err := cmd.CombinedOutput()
require.NoError(t, err)
require.Equal(
t,
`is odd
is odd
is even
is even
is odd
is odd
is even
is even
is odd
is odd
is even
is even
is odd
is odd
is even
is even
is odd
is odd
is even
is even
`,
string(out),
)
require.Equal(t, 0, cmd.ProcessState.ExitCode())
}
printSlow
version will also trigger the bug
component PrintSlow(data string) (sig any) {
nodes { p1 Println, time.Sleep }
200000000 -> sleep:dur // 200 ms
:data -> p1 -> sleep:data -> :sig
}
Just to be pedantic, #575 is about early termination whereas this one is about items printed out of order. Is that a correct interpretation?
@Catya3 yeah, don't sure if they are related
unpredictable termination was because of branching, basically data-race
this one also looks like some kind of race
It looks like For actually fixes the unpredictable termination and now we have items executed out of order. Not sure what causes it
Yeah I think the same. I just wanna keep 575 opened until we fix this one, just to be sure
Closed in favor of #644
Output isn't consistent
Related to #575