Skip to content
This repository was archived by the owner on Feb 27, 2020. It is now read-only.

Integration tests for livelog and fix for s3 upload #373

Merged
merged 16 commits into from
Apr 30, 2018

Conversation

jonasfj
Copy link
Contributor

@jonasfj jonasfj commented Apr 25, 2018

No description provided.

@ccooper ccooper added the review label Apr 25, 2018
@jonasfj jonasfj requested a review from walac April 25, 2018 15:29
@coveralls
Copy link

coveralls commented Apr 25, 2018

Coverage Status

Coverage decreased (-0.02%) to 46.076% when pulling a8b8c6b on livelog-integration-test into 21d46a6 on master.

@jonasfj
Copy link
Contributor Author

jonasfj commented Apr 25, 2018

Now this also fixes empty artifact upload, issue #375

// If we haven't made a superseded task yet we do that now
if supersededTaskID == "" {
supersededTaskID = taskID
// Make first other taskId be superseding this taskId
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't understand this sentence

{
"name": "public/result.txt",
"type": "file",
"path": "no-such-file-` + filename + `.txt"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the variable filename defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably higher up...this is just a mechanically refactored test case.. see the commit

if goruntime.GOOS == "windows" {
// On windows this fails with:
// dial tcp 127.0.0.1:49523: socket: The requested service provider could not be loaded or initialized.
// Calling the URL from this process works, but the subprocess fails...
t.Skip("TODO: Fix the GetUrl on windows, probably firewall interference")
}

var u string
// Generate some messages that can be written log, so we can read them from livelog
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "... can be written log ..."

"very-long": base64.StdEncoding.EncodeToString(randMessage),
}

// Generate some replies that can be written log, so we know that test-server was called
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "... can be written log ..."

workertest.Case{
Engine: "script",
Concurrency: 1,
Concurrency: 5, // this test runs a lot of task, we better run them in parallel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "a lot of tasks"

taskID := r.URL.Query().Get("taskId")
msg := messages[r.URL.Query().Get("msgSize")]
behavior := r.URL.Query().Get("behavior")
reply := replies[r.URL.Query().Get("replySize")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are msg and reply buffers or buffer sizes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are strings... messages is a mapping from string representing size to message as string.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is somewhat confusing IMO, but we can talk and address this in another PR

}
}

// Signal that eveyrthing went well, and return reply.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "everything"

@@ -33,7 +33,7 @@ type Case struct {
Concurrency int // Worker concurrency, if zero defaulted to 1 and tasks will sequantially dependent
StoppedGracefully bool // True, if worker is expected to stop gracefully
StoppedNow bool // True, if worker is expected to stop now
Timeout time.Duration // Test timeout, defaults to 10 Minute
Timeout time.Duration // Test timeout, defaults to 8 Minute
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "Minutes"

}

// Create task asynchronously with a limit of 10 concurrent calls to make
// that it goes fairly faster, when there is a lot tasks.
Copy link
Contributor

@walac walac Apr 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "a lot of"

tdefs[i].Metadata.Owner = "[email protected]"
}

// Create task asynchronously with a limit of 10 concurrent calls to make
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "tasks"

@@ -529,6 +529,16 @@ func (q *FakeQueue) internalPutArtifact(taskID string, runID int, name string, p
// Real S3/azure is slow, let's add a bit of jitter to get some intermittent bugs
time.Sleep(time.Duration(rand.Intn(15)) * time.Millisecond) // sleep 0 - 15ms

// S3 always requires a content-length, if it's not present we have bug
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "have a bug"

Copy link
Contributor

@walac walac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commits then should be squashed

@jonasfj jonasfj force-pushed the livelog-integration-test branch from 8b8a29a to 0256c2c Compare April 29, 2018 21:42
@jonasfj jonasfj force-pushed the livelog-integration-test branch from 0256c2c to 57ccd6f Compare April 29, 2018 21:59
@jonasfj jonasfj requested a review from walac April 29, 2018 22:29
@jonasfj
Copy link
Contributor Author

jonasfj commented Apr 29, 2018

@walac, I added a fix for the broken tests in master... due to missing test fixes from the / fixes...
A previously commit in this sequence fixes a bug a that hid CI issues in one of the test configurations.

I also rebased and merged a few of the commits... So each commit does one thing.

@jonasfj jonasfj merged commit cd1dc4e into master Apr 30, 2018
@jonasfj jonasfj deleted the livelog-integration-test branch April 30, 2018 13:11
@ccooper ccooper removed the review label Apr 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants