fn: enable failing test back (#826)

* fn: enable failing test back

* fn: fortifying the stderr output

Modified limitWriter to discard excess data instead
of returning error, this is to allow stderr/stdout
pipes flowing to avoid head-of-line blocking or
data corruption in container stdout/stderr output stream.
This commit is contained in:
Tolga Ceylan
2018-03-09 09:57:28 -08:00
committed by Reed Allman
parent f85294b0fc
commit 7177bf3923
7 changed files with 81 additions and 25 deletions

View File

@@ -146,16 +146,17 @@ func TestRouteRunnerPost(t *testing.T) {
}
}
// removing this flappy test pending on resolution of
func skipTestRouteRunnerIOPipes(t *testing.T) {
func TestRouteRunnerIOPipes(t *testing.T) {
buf := setLogBuffer()
isFailure := false
// let's make freezer immediate, so that we don't deal with
// more timing related issues below. Slightly gains us a bit more
// determinism.
tweaker := envTweaker("FN_FREEZE_IDLE_MSECS", "0")
defer tweaker()
tweaker1 := envTweaker("FN_FREEZE_IDLE_MSECS", "0")
tweaker2 := envTweaker("FN_MAX_LOG_SIZE", "5")
defer tweaker1()
defer tweaker2()
// Log once after we are done, flow of events are important (hot/cold containers, idle timeout, etc.)
// for figuring out why things failed.
@@ -188,8 +189,6 @@ func skipTestRouteRunnerIOPipes(t *testing.T) {
delayedGarbage := `{"isDebug": true, "postOutGarbage": "YOGURT_YOGURT_YOGURT", "postSleepTime": 1000}`
ok := `{"isDebug": true}`
//multiLogExpect := []string{"BeginOfLogs", "EndOfLogs"}
containerIds := make([]string, 0)
for i, test := range []struct {
@@ -276,7 +275,6 @@ func skipTestRouteRunnerIOPipes(t *testing.T) {
t.Logf("Test %d: dockerId: %v", i, containerIds[i])
time.Sleep(test.sleepAmount)
}
jsonIds := containerIds[0:4]
// now cross check JSON container ids: