// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library barback.test.package_graph.transform_test;

import 'package:barback/src/utils.dart';
import 'package:scheduled_test/scheduled_test.dart';

import '../utils.dart';

main() {
  initConfig();

  test("handles many parallel transformers", () {
    var files = new List.generate(100, (i) => "app|$i.txt");
    var rewrite = new RewriteTransformer("txt", "out");
    initGraph(files, {"app": [[rewrite]]});

    // Pause and resume apply to simulate parallel long-running transformers.
    rewrite.pauseApply();
    updateSources(files);
    schedule(pumpEventQueue);
    rewrite.resumeApply();

    for (var i = 0; i < 100; i++) {
      expectAsset("app|$i.out", "$i.out");
    }
    buildShouldSucceed();

    expect(rewrite.maxParallelRuns, completion(equals(10)));
  });
}

// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library barback.test.package_graph.transform_test;

import 'package:barback/src/utils.dart';
import 'package:scheduled_test/scheduled_test.dart';

import '../utils.dart';

main() {
  initConfig();

  test("handles many parallel transformers", () {
    currentSchedule.timeout *= 3;
    var files = new List.generate(100, (i) => "app|$i.txt");
    var rewrite = new RewriteTransformer("txt", "out");
    initGraph(files, {"app": [[rewrite]]});

    // Pause and resume apply to simulate parallel long-running transformers.
    rewrite.pauseApply();
    updateSources(files);
    schedule(pumpEventQueue);
    rewrite.resumeApply();

    for (var i = 0; i < 100; i++) {
      expectAsset("app|$i.out", "$i.out");
    }
    buildShouldSucceed();

    expect(rewrite.maxParallelRuns, completion(equals(10)));
  });
}

Increase barback scheduled_test timeout for many_parallel_transformers test.
Increase barback scheduled_test timeout for many_parallel_transformers test.

BUG=dartbug.com/15483

Review URL: https://codereview.chromium.org//102433007

git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@30978 260f80e4-7a28-3924-810f-c04153c831b5
