The resharding_nonblocking_coordinator_rebuild.js test intentionally triggers elections on the config server replica set. It also steps up the resharding operation to abort to work around a limitation of the data consistency checks in the ReshardingTest fixture. However, the primary shard of the database will retry the _configsvrReshardCollection command on retryable errors and can lead there to be a second resharding operation after the first. (In the cases where the resharding succeeded this second invocation would have been a no-op from the requested shard key matching the newly set one.) The second resharding operation ends up failing with a DuplicateKey because the conflicting documents end up being cloned by the ReshardingCollectionCloner rather than applied by the ReshardingOplogApplier. The DuplicateKey error is acceptable for the purposes of this test because it still indicates the recipient was able to update its state in config.reshardingOperations on the config server primary to "applying" without blocking replication.