Skip to content

Commit

Permalink
restart test still fails, increasing the timeout to 100ms?
Browse files Browse the repository at this point in the history
  • Loading branch information
adamtajti committed Aug 29, 2023
1 parent 39cad2c commit c638e06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions integration-tests/fault-injection/harness/inserter.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ func RunInserts(client *mongo.Database, numInserts int, frequency time.Duration)
for i := 0; i < numInserts; i++ {
id := fmt.Sprintf("doc%d", i)

// We set a 50ms timeout for the insert: long enough that the insert will
// We set a 100ms timeout for the insert: long enough that the insert will
// succeed if Mongo is working normally, but too short for it to retry during
// a failover.

// The write may still get through even if the InsertOne call errors out and if the resulting InsertedID is nil.
ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond)
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
defer cancel()
insertResult, err := client.Collection("Test").InsertOne(ctx, bson.M{
"_id": id,
Expand Down

0 comments on commit c638e06

Please sign in to comment.