package acceptance_test

import (
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/onsi/gomega/gexec"

	"github.com/cloudfoundry-incubator/cf-test-helpers/cf"
	"github.com/cloudfoundry-incubator/cf-test-helpers/generator"
)

var _ = Describe("PythonBuildpack", func() {
	var (
		appName string
	)

	It("should not fail when pushing a python app without Procfile", func() {
		appName = generator.PrefixedRandomName("CATS-APP-")
		Expect(cf.Cf(
			"push", appName,
			"--no-start",
			"-m", DEFAULT_MEMORY_LIMIT,
			"-p", "../../example-apps/simple-python-app",
			"-b", "python_buildpack",
			"-c", "python hello.py",
			"-d", config.AppsDomain,
		).Wait(CF_PUSH_TIMEOUT)).To(Exit(0))
		Expect(cf.Cf("start", appName).Wait(DEFAULT_TIMEOUT * 2)).To(Exit(0))
	})

})

package acceptance_test

import (
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/onsi/gomega/gexec"

	"github.com/cloudfoundry-incubator/cf-test-helpers/cf"
	"github.com/cloudfoundry-incubator/cf-test-helpers/generator"
)

var _ = Describe("PythonBuildpack", func() {
	var (
		appName string
	)

	It("should not fail when pushing a python app without Procfile", func() {
		appName = generator.PrefixedRandomName("CATS-APP-")
		Expect(cf.Cf(
			"push", appName,
			"--no-start",
			"-m", DEFAULT_MEMORY_LIMIT,
			"-p", "../../example-apps/simple-python-app",
			"-b", "python_buildpack",
			"-c", "python hello.py",
			"-d", config.AppsDomain,
		).Wait(CF_PUSH_TIMEOUT)).To(Exit(0))
		Expect(cf.Cf("start", appName).Wait(CF_PUSH_TIMEOUT)).To(Exit(0))
	})

})

Change timeout for test python_buildpack Procfile
Change timeout for test python_buildpack Procfile

The Python apps take longer to stage. We found out that the current
`cf start` for the python buildpack test is timing out, specially
when running the test.

That is very likely due the multiple nodes causing load on the platform.

To reduce the number of failures, we will increase the timeout by using
CF_PUSH_TIMEOUT (2 minutes) instead of DEFAULT_TIMEOUT*2 (1 minute) in
the `cf start` of the python app.
